Stirling's Approximation Formula Solver with Worked Examples

Stirling’s approximation says for large . Use the calculator to find the approximation for a given .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

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.

  • : approximation to n!
  • : the number n

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 grows.

For , the approximation is 3,598,696, compared with the exact : 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

  1. Compute .
  2. Compute .
  3. Multiply.
  4. Compare with the exact factorial.

Graph

n! divided by Stirling’s approximation01234567890.9811.021.041.061.081.1n! divided by Stirling’s approximationxyGraph 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 with Stirling’s formula.

Stirling's approximation Answer checked
Answer
S≈3599000S\approx 3599000
  1. The formula
    Stirling's approximation. In this formula is the approximation to n!, is the the number n.
  2. What we know and what we want
    We know and we want to find , the approximation to n!.
  3. Substitute the numbers
  4. Calculate
  5. Check by substituting back
    Put all the values back into the original formula: both sides should match.

Example 2: n = 5

Estimate with Stirling’s formula (the exact value is 120).

Stirling's approximation Answer checked
Answer
S≈118S\approx 118
  1. The formula
    Stirling's approximation. In this formula is the approximation to n!, is the the number n.
  2. What we know and what we want
    We know and we want to find , the approximation to n!.
  3. Substitute the numbers
  4. Calculate
  5. Check by substituting back
    Put all the values back into the original formula: both sides should match.

Example 3: n = 20

Estimate with Stirling’s formula.

Stirling's approximation Answer checked
Answer
S≈2423000000000000000S\approx 2423000000000000000
  1. The formula
    Stirling's approximation. In this formula is the approximation to n!, is the the number n.
  2. What we know and what we want
    We know and we want to find , the approximation to n!.
  3. Substitute the numbers
  4. Calculate
  5. Check by substituting back
    Put all the values back into the original formula: both sides should match.

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.

  1. Square root√(2π × 5) = 5.605
  2. Power(5 ÷ e)⁵ = 21.056
  3. Multiply118.02
  4. Check: 5! = 120 ✓S ≈ 118.02.

n = 10

Estimate 10! to the nearest whole number.

  1. SubstituteS = √(20π) × (10 ÷ e)¹⁰
  2. CalculateS = 3 598 696
  3. Check: 10! = 3 628 800 ✓S ≈ 3 598 696.

The ratio Higher

Find S ÷ n! for n = 10 to 4 decimal places.

  1. Divide3 598 696 ÷ 3 628 800
  2. Calculate0.9917
  3. Check: close to 1 ✓The ratio is 0.9917.

Logarithm form Higher

Compare n ln n − n with ln n! for n = 10.

  1. Estimate10 ln 10 − 10 = 13.03
  2. Exactln 10! = 15.10
  3. 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

  1. n! ≈ √(2πn)(n ÷ e)ⁿ.
  2. Use the exp key for e.
  3. Compare with n! for small n.
  4. Error shrinks as n grows.
  5. 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.

Solve: …

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.

More in Calculus and the formula sheets.