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.