Stirling's Approximation
Stirling's approximation estimates the factorial of large numbers using logarithms, making calculations in statistics and physics tractable.
The Formula
or equivalently:
ln(n!) ≈ n×ln(n) − n + ½×ln(2πn)
Stirling's approximation, named after Scottish mathematician James Stirling who published it in 1730, provides an efficient way to estimate the factorial of a large number without computing the exact product. Factorials grow astronomically fast — 100! has 158 digits — making exact calculations impractical or even impossible for very large n.
The approximation becomes more accurate as n increases. For n = 10, the error is about 0.8%. For n = 100, the error drops to about 0.08%. For n = 1000 and beyond, the approximation is accurate to better than 0.008% — effectively exact for most practical purposes.
The logarithmic form is especially useful in statistical mechanics and information theory, where expressions like ln(n!) appear naturally in entropy calculations. Working in logarithms avoids the enormous intermediate numbers that would otherwise overflow any computer.
Variables
| Symbol | Meaning | Unit |
|---|---|---|
| n! | Factorial of n (the exact value being approximated) | dimensionless |
| n | A positive integer (the approximation works best for large n) | dimensionless |
| e | Euler's number ≈ 2.71828 | dimensionless |
| π | Pi ≈ 3.14159 | dimensionless |
| ln | Natural logarithm (base e) | — |
Example 1
Estimate 10! using Stirling's approximation and compare to the exact value.
Apply: 10! ≈ √(2π × 10) × (10/e)¹⁰
√(20π) = √62.832 ≈ 7.926
(10/2.71828)¹⁰ = (3.6788)¹⁰ ≈ 453,099
Approximation: 7.926 × 453,099 ≈ 3,598,600
Exact value of 10! = 3,628,800 — Stirling's result is within 0.8%, already quite close for n = 10
Example 2
Use the logarithmic form to estimate ln(100!) for use in a statistical mechanics entropy calculation.
ln(100!) ≈ 100 × ln(100) − 100 + ½ × ln(200π)
= 100 × 4.6052 − 100 + ½ × ln(628.32)
= 460.52 − 100 + ½ × 6.4428
= 460.52 − 100 + 3.221 = 363.74
ln(100!) ≈ 363.74 — the exact value is 363.74 to 5 significant figures. The approximation is essentially perfect here.
When to Use It
Use Stirling's approximation when:
- Computing factorials of large numbers that exceed standard calculator limits
- Simplifying expressions involving factorials in combinatorics and probability
- Deriving entropy formulas in statistical mechanics (Boltzmann entropy)
- Approximating binomial coefficients for large n in information theory
- Analyzing algorithm complexity in computer science when factorials appear in growth rates