On this page
Factorials grow very fast: 10! is already 3,628,800, and 100! has 158 digits. Stirling's formula turns that runaway product into something you can estimate by hand, and it shows up in limits, in probability, and in physics whenever you count the arrangements of many particles.
What is Stirling's approximation for n!?
Stirling's approximation says that n! ≈ √(2πn)(n/e)ⁿ, in the sense that the ratio of the two sides tends to 1 as n grows (Stirling's approximation, Wikipedia). The same result, written for the gamma function Γ(n + 1) = n!, is in the NIST Digital Library of Mathematical Functions, section 5.11.
Abraham de Moivre found the shape n! ≈ C·n^(n+½)·e^(−n) in 1721, and James Stirling showed in 1730 that the constant C is exactly √(2π) (history of the formula, Wikipedia).
Where does n! ≈ (n/e)ⁿ come from?
Take logs. The product becomes a sum: ln n! = ln 1 + ln 2 + ... + ln n. That sum is the total area of bars of width 1 and heights ln 2, ln 3, ..., ln n, and those bars sit just above the curve y = ln x (the picture at the top of this post).
So ln n! ≈ ∫₁ⁿ ln x dx = n ln n − n + 1, which you can check by integrating by parts. For large n the 1 hardly matters, and exponentiating gives the rough rule n! ≈ (n/e)ⁿ.
The bars overshoot the curve by a sliver at every step, and the slivers add up. Treating each sliver as a triangle (the trapezium rule) recovers an extra ½ ln n, which is where the √n comes from; the last constant, √(2π), needs a cleverer argument using Wallis's product (the derivation, Wikipedia).
How accurate is Stirling's formula for n = 10?
Here is the check, worked with the formula as stated in DLMF 5.11. All logs are natural logs.
True value: 10! = 3,628,800, so ln 10! ≈ 15.104.
Rough rule: 10 ln 10 − 10 ≈ 13.026, so (10/e)¹⁰ ≈ 454,000. That is about 8 times too small.
Add ½ ln(20π) ≈ 2.070. The log becomes 15.096, and √(20π)(10/e)¹⁰ ≈ 3,598,696.
Error: 3,628,800 − 3,598,696 = 30,104, which is 0.83% of the true value.
Multiply by the next correction, (1 + 1/120). The estimate becomes about 3,628,685, an error of about 0.003%.
The 1/(12n) correction is the first coefficient of the Stirling series, listed as 1/12 in DLMF 5.11. Herbert Robbins proved in 1955 that for every positive integer n, n! lies between √(2πn)(n/e)ⁿ·e^(1/(12n+1)) and √(2πn)(n/e)ⁿ·e^(1/(12n)) (Robbins, The American Mathematical Monthly; the bounds as quoted in Wikipedia). So the plain formula always comes out slightly low, by a fraction close to 1/(12n): about 0.8% at n = 10 and about 0.08% at n = 100.
How do you use Stirling's formula to estimate binomial coefficients?
The middle binomial coefficient is ²ⁿCₙ = (2n)!/(n!)². Put Stirling's formula into the top and the bottom:
Top: (2n)! ≈ √(4πn)·(2n/e)^(2n) = √(4πn)·4ⁿ·(n/e)^(2n).
Bottom: (n!)² ≈ 2πn·(n/e)^(2n).
The (n/e)^(2n) cancels, leaving ²ⁿCₙ ≈ 4ⁿ/√(πn).
Try n = 10: 4¹⁰/√(10π) ≈ 1,048,576/5.605 ≈ 187,080, against the true ²⁰C₁₀ = 184,756, so about 1.3% high. At n = 50 the estimate is about 1.011 × 10²⁹ against the true 1.009 × 10²⁹, only 0.25% high.
That gives a neat probability fact: the chance of exactly 50 heads in 100 fair tosses is ¹⁰⁰C₅₀/2¹⁰⁰ ≈ 1/√(50π) ≈ 0.080, about 8%. If you have met ²ⁿCₙ as the sum of the squares of binomial coefficients, our post on why the sum of squares of binomial coefficients equals ²ⁿCₙ shows where the number comes from, and how to prepare permutations and combinations for JEE Main covers the exact counting side.
A checklist for estimating any large factorial
Work with ln n!, never with n! directly.
Write ln n! ≈ n ln n − n + ½ ln(2πn), the log form of Stirling's formula in DLMF 5.11.
For a ratio of factorials, such as a binomial coefficient or a probability, cancel the (n/e)ⁿ parts before putting in numbers.
If you need the number of digits, convert at the end: log₁₀ n! = ln n! / ln 10.
Sanity-check the method on a small case, such as n = 10, where you know the answer.
Step 4 on 100!: ln 100! ≈ 100 ln 100 − 100 + ½ ln(200π) ≈ 363.74, and 363.74 / 2.3026 ≈ 157.97, so 100! has 158 digits.
The same sum-to-integral step solves limits such as lim (n!)^(1/n)/n = 1/e; our guide to integral calculus for JEE Advanced has more on turning sums into integrals. To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, and the Fermi Concept Library gives every mathematics concept its own lesson and its place in the map.



