Give every value except the one you want, or write the letter with a question mark, for example n=10 or n=5. Every answer is checked by putting it back into the formula.
S : approximation to n! n : the number n
On this page
Before you start
This page is easier if you are comfortable with:
factorials such as 5! = 120 the numbers e and π using the exp key on a calculator
What Stirling's approximation means
Factorials grow extremely fast, and Stirling’s formula gives a simple estimate. The ratio of the exact value to the approximation tends to 1 as n grows.
For n = 10 , the approximation is 3,598,696, compared with the exact 10 ! = 3 , 628 , 800 : within 1%.
It is used in probability, statistical mechanics and combinatorics to estimate binomial coefficients. It approximates the gamma function at integer values, and the ratio test can be applied to series of factorials.
This page is part of Series and convergence in Calculus . Topics that work alongside it: Gamma function , Binomial coefficient , Ratio test , Radius of convergence , Absolute convergence and Alternating series test (Leibniz) .
What is it used for? Stirling’s approximation n! ≈ √(2πn)(n/e)ⁿ estimates large factorials without multiplying them out.
How to use the stirling's approximation formula
Compute 2 π n . Compute ( e n ) n . Multiply. Compare with the exact factorial.
Graph n! divided by Stirling’s approximation 0 1 2 3 4 5 6 7 8 9 0.98 1 1.02 1.04 1.06 1.08 1.1 n! divided by Stirling’s approximation x y Graph with x from 0 to 9 and y from 0.98 to 1.1. Shows n! ÷ Stirling (8); the curve y = 1+0*x. The ratio of n! to the approximation tends to 1. It is already within about 1% at n = 8, and the relative error keeps shrinking as n grows.
Worked examples
Each example below was worked out by the solver on this page and checked by substituting the answer back into the formula.
Example 1: n = 10 Estimate 10 ! with Stirling’s formula.
Try this in the solver: n=10
Stirling's approximation Answer checked
Answer
S ≈ 3599000 S\approx 3599000 S ≈ 3599000 The formula
Stirling's approximation. In this formula S is the approximation to n!, n is the the number n.
What we know and what we want
We know n = 10 and we want to find S , the approximation to n!.
Substitute the numbers
Calculate
S ≈ 3599000
Check by substituting back
Put all the values back into the original formula: both sides should match.
3599000 = 2 × π × 10 × ( e 1 10 ) 10 ✓ Example 2: n = 5 Estimate 5 ! with Stirling’s formula (the exact value is 120).
Try this in the solver: n=5
Stirling's approximation Answer checked
Answer
S ≈ 118 S\approx 118 S ≈ 118 The formula
Stirling's approximation. In this formula S is the approximation to n!, n is the the number n.
What we know and what we want
We know n = 5 and we want to find S , the approximation to n!.
Substitute the numbers
Calculate
S ≈ 118
Check by substituting back
Put all the values back into the original formula: both sides should match.
Example 3: n = 20 Estimate 20 ! with Stirling’s formula.
Try this in the solver: n=20
Stirling's approximation Answer checked
Answer
S ≈ 2423000000000000000 S\approx 2423000000000000000 S ≈ 2423000000000000000 The formula
Stirling's approximation. In this formula S is the approximation to n!, n is the the number n.
What we know and what we want
We know n = 20 and we want to find S , the approximation to n!.
Substitute the numbers
Calculate
S ≈ 2423000000000000000
Check by substituting back
Put all the values back into the original formula: both sides should match.
2423000000000000000 = 2 × π × 20 × ( e 1 20 ) 20 ✓
Special cases
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
n = 5 S ≈ 118.02, while 5! = 120
A close estimate.
n = 10 S ≈ 3 598 696, while 10! = 3 628 800
About 0.8% too low.
The ratio S ÷ 10! ≈ 0.9917
The ratio tends to 1.
Log form ln 10! ≈ 15.10
ln n! ≈ n ln n − n is cruder.
Word problems
For large n, n! ≈ √(2πn) (n ÷ e)ⁿ. The relative error shrinks as n grows.
n = 5 Estimate 5! using Stirling’s formula to 2 decimal places.
Square root √(2π × 5) = 5.605 Power (5 ÷ e)⁵ = 21.056 Multiply 118.02 Check: 5! = 120 ✓ S ≈ 118.02.
n = 10 Estimate 10! to the nearest whole number.
Substitute S = √(20π) × (10 ÷ e)¹⁰ Calculate S = 3 598 696 Check: 10! = 3 628 800 ✓ S ≈ 3 598 696.
The ratio Higher Find S ÷ n! for n = 10 to 4 decimal places.
Divide 3 598 696 ÷ 3 628 800 Calculate 0.9917 Check: close to 1 ✓ The ratio is 0.9917.
Logarithm form Higher Compare n ln n − n with ln n! for n = 10.
Estimate 10 ln 10 − 10 = 13.03 Exact ln 10! = 15.10 Check: the full formula is closer ✓ The cruder form is 2.07 too low.
Common mistakes
Leaving out the square root S = (5 ÷ e)⁵ = 21.06 ✗
S = √(2π × 5) × 21.06 = 118.02 ✓
Include √(2πn).
Using 10 for e S = √(10π) × (5 ÷ 10)⁵ ✗
divide by e = 2.718 ✓
e is not 10.
Expecting an exact answer S = n! ✗
S ≈ n! ✓
It is an approximation.
Using it for tiny n n = 1 or 2 treated as accurate ✗
use exact factorials for small n ✓
The error is larger.
Exam tips
n! ≈ √(2πn)(n ÷ e)ⁿ.
Use the exp key for e.
Compare with n! for small n.
Error shrinks as n grows.
Large n only.
Practice questions
Try each one on paper, then open the answer. Use the solver above to see the full working.
1. Estimate 5! with Stirling to 2 decimal places Foundation S = 118.02
2. Estimate 6! with Stirling to 2 decimal places Foundation S = 710.08
3. Estimate 8! with Stirling to the nearest whole number Foundation S = 39902
4. Find (n ÷ e)ⁿ for n = 5 to 2 decimal places Higher (5 ÷ e)⁵ = 21.06
5. Find √(2πn) for n = 10 to 2 decimal places Higher √(20π) = 7.93
6. Find 10! ÷ 5! as a whole number Higher 3 628 800 ÷ 120 = 30 240
Practice generator Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Foundation Higher Mixed New question
Solve: …
The practice generator needs JavaScript.
Key terms
Factorial n! = n × (n − 1) × ... × 1. Approximation A close but not exact value. Relative error Error divided by the true value. e About 2.718. π About 3.142. Asymptotic Getting closer for large n.
Frequently asked questions
What is Stirling’s approximation? n! ≈ √(2πn)(n ÷ e)ⁿ.
How accurate is it? About 0.8% low at n = 10.
When is it useful? For very large factorials.
Does the error shrink? Yes, as n grows.
What is n! exactly? The product of 1 to n.
Which page covers other number patterns? triangular numbers .