Back to latest

Engineering Reads

Engineering Reads — 2026-08-28 The Big Idea Astronomical combinatorial growth does not have to remain an opaque black box; by grounding estimation in the continuous Gamma …

The Big Idea

Astronomical combinatorial growth does not have to remain an opaque black box; by grounding estimation in the continuous Gamma function and Stirling’s approximation, software engineers can mentally determine the digit length of massive factorials using simple logarithmic landmarks.

Deep Reads

How big are factorials? · Eli Bendersky · eli.thegreenplace.net Estimating the order of magnitude of enormous factorials—such as the 68 digits of \(52!\)—without a calculator reduces to a practical mental formula: \(\text{digits} \approx n \log_{10}(n/e) + 2\). Under the hood, the derivation begins with the Gamma function \(\Gamma(n+1) = n!\), translating the discrete factorial into a continuous definite integral whose integrand is then evaluated near its maximum via Laplace’s method to establish Stirling’s approximation, \(n! \approx \sqrt{2\pi n}(n/e)^n\). Applying a base-10 logarithm yields the linear term \(n \log_{10}(n/e)\) alongside a sublinear offset \(\log_{10}(\sqrt{2\pi n})\), which contributes roughly two additional digits for any \(n\) under 1,600. While conventional engineering intuition often assumes factorials quickly outpace paper-and-pencil estimation, the acceptable trade-off here is sacrificing exact precision for an answer within one or two digits using basic memory anchors like \(\log_{10}(2) \approx 0.3\) and \(e \approx 2.718\). Any practitioner interested in algorithm analysis, capacity planning, or the mathematical underpinnings of back-of-the-envelope estimation should spend ten minutes with this breakdown.


💡 We could build a quick Python benchmark script comparing this logarithmic approximation against Python’s native arbitrary-precision integer factorials across various ranges of \(n\) to inspect the error boundaries firsthand.

Filed under Blogs

Search MacWorks

Enter at least two characters.