The Gamma Function, the Zeta Function & Dirichlet Series

Stirling's asymptotic formula

/ STUR-ling /

How big is 100! ? Multiplying it out is hopeless by hand, and even knowing it is roughly 9.3 * 10^157 is not obvious from the definition. Stirling's formula is the answer: for large arguments, the factorial (and the gamma function) is captured astonishingly well by elementary functions. In its factorial form, n! is approximately sqrt(2 pi n) * (n/e)^n. The two ingredients are a power (n/e)^n that supplies the explosive growth, and a gentle correction sqrt(2 pi n) that fixes the size.

The proper statement is for the gamma function and is asymptotic: as |z| -> infinity in any sector avoiding the negative real axis, Gamma(z) is asymptotic to sqrt(2 pi) z^(z - 1/2) e^(-z), and more precisely log Gamma(z) = (z - 1/2) log z - z + (1/2) log(2 pi) + 1/(12 z) - ... . The word 'asymptotic' is exact and important: the ratio of the two sides tends to 1, even though the difference need not tend to 0, and the series in 1/z is divergent yet each truncation is a genuine approximation. The complex-analytic proof is a triumph of the saddle-point (steepest-descent) method applied to Euler's integral: the integrand t^(z-1) e^(-t) peaks sharply near t = z, and a Gaussian approximation around that peak produces every term.

Stirling's formula is everywhere quantities grow factorially. It underlies the central limit theorem's bell curve (via n! in the binomial coefficients), the entropy formula in statistical mechanics, the analysis of algorithms, and the asymptotics of the zeta function in its functional equation. The honest caveats: it is an approximation that is excellent for large |z| and useless for small z (it says nothing about 3! that you would trust), and the full series does not converge — adding more and more terms eventually makes things WORSE, so one stops at the smallest term. It is the prototype of an asymptotic, as opposed to convergent, expansion.

Estimate 10!. Stirling gives sqrt(2 pi * 10) * (10/e)^10 = sqrt(20 pi) * (10/e)^10, which is about 3,598,696. The exact value is 10! = 3,628,800. The relative error is under 1 percent even at n = 10, and it shrinks as n grows; the next correction factor (1 + 1/120) closes most of the remaining gap.

Already accurate to under 1 percent at n = 10; the formula is asymptotic, so its accuracy improves as the argument grows.

Stirling's series in powers of 1/z is asymptotic, not convergent — for any fixed z, summing all its terms diverges. You get the best approximation by stopping at the smallest term, not by adding more.

Also called
Stirling approximation史特靈公式n! 的漸近估計