Stirling's Formula

Asymptotic approximation for n! and log n!, used for entropy and large-N counting in statistical mechanics.
Stirling’s Formula

Stirling’s formula is a basic asymptotic tool for combinatorial and phase-space counting, and it is frequently used when connecting microscopic counting to and to information-theoretic quantities like .

Statement

As nn\to\infty,

n!2πn(ne)n. n! \sim \sqrt{2\pi n}\,\Big(\frac{n}{e}\Big)^n.

Equivalently,

log(n!)=nlognn+12log(2πn)+o(1). \log(n!) = n\log n - n + \tfrac12\log(2\pi n) + o(1).

A common quantitative refinement is: for every integer n1n\ge 1 there exists θn(0,1)\theta_n\in(0,1) such that

n!=2πn(ne)nexp ⁣(θn12n). n! = \sqrt{2\pi n}\,\Big(\frac{n}{e}\Big)^n \exp\!\Big(\frac{\theta_n}{12n}\Big).

In particular,

log(n!)=nlognn+12log(2πn)+O ⁣(1n). \log(n!) = n\log n - n + \tfrac12\log(2\pi n) + O\!\Big(\frac{1}{n}\Big).

Key hypotheses and conclusions

Hypotheses

  • nNn\in\mathbb{N} and nn\to\infty.

Conclusions

  • Accurate leading-order and next-order asymptotics for n!n! and log(n!)\log(n!).
  • Enables asymptotics for multinomial coefficients; e.g. leading terms produce entropy-like functionals.

Proof idea / significance

One proof route uses integral bounds for log(n!)=k=1nlogk\log(n!)=\sum_{k=1}^n \log k compared to 1nlogxdx\int_1^n \log x\,dx, plus a refinement (e.g. Euler–Maclaurin) to obtain the 12logn\tfrac12\log n correction and the constant 2π\sqrt{2\pi}. Another route uses Γ(n+1)=0tnetdt\Gamma(n+1)=\int_0^\infty t^n e^{-t}\,dt and applies a Laplace/saddle-point argument (see ).

In statistical mechanics, Stirling’s formula converts factorial growth in state counting (e.g. indistinguishable particles, multinomial occupations) into extensive terms of order nn plus subextensive corrections. This is one mechanism by which entropy densities emerge from microscopic counting.