MathorynMathematical Formula Database

Combinatorics

Stirling's Approximation

Stirling's formula approximates the factorial of a large number with relative error about 112n\frac{1}{12n}. It is used to estimate large factorials and binomial coefficients, in statistical mechanics style counting and in asymptotic analysis.

n!≈2πn(ne)nn!\approx\sqrt{2\pi n}\left(\frac ne\right)^n
LaTeXn!\approx\sqrt{2\pi n}\left(\frac ne\right)^n

Variables

nn
positive integer (large)
ee
Euler's number ≈ 2.71828

Example

Estimate 10!10!.

  1. 20π≈7.92665\sqrt{20\pi}\approx7.92665, (10e)10≈453999.3\left(\frac{10}{e}\right)^{10}\approx453999.3.
  2. Product ≈3598696\approx3598696; the exact value is 36288003628800.

Answer: 10!≈3.5987×10610!\approx3.5987\times10^6, about 0.8%0.8\% low.

Related formulas