A fast-growing factorial gets guessed by one simple formula here. On a log scale, the two curves nearly coincide.
Factorials grow too fast to keep computing head-on. The approximation tracks that growth almost exactly. Its relative error shrinks as the terms grow. Roughly, it falls like 1 over 12 times the index. Where π enters is only sketched at the idea level.
For example, guess a tall 🏢 building's height by counting steps. The taller the building, the smaller the share of one step's error in the whole. That is why the approximation sharpens for large numbers.
n!≈2πn(en)n
Examples & Exercises
Compute the relative error of Stirling's formula at n=10 and compare with 1201. (A numerical check, not a proof.)
10!∣S(10)−10!∣≈0.008296≈1201
n=10: the two curves overlap on the log scale.Show hint
10!=3628800. S(10)=20π(e10)10≈3598695.62.
The relative error =36288003628800−3598695.62≈0.008296.
12⋅101=1201≈0.008333 — matching the claim. (This is a numerical check, not a proof of the error formula.)
Explain the picture comparing ln(n!)=∑k=1nlnk with ∫1nlnxdx. (Idea level.)
k=1∑nlnk≈∫1nlnxdx=nlnn−n+1
The sum of the bars and the area under the curve are close.Show hint
ln(n!)=∑k=1nlnk is the total area of bars under the graph of y=lnx.
The integral ∫1nlnxdx=nlnn−n+1 is the area under the curve — close to the bar sum.
The gap grows like 21ln(2πn), and that correction produces the 2πn. The rigorous derivation is omitted — idea level.
The central binomial coefficient is smaller than 4n by πn.Show proof
Stirling in the numerator: (2n)!≈4πn(e2n)2n.
Denominator: (n!)2≈2πn(en)2n.
First note asymptotic equivalence is preserved under squaring and division: for positive sequences, if An∼Bn and Cn∼Dn, write An=Bn(1+o(1)) and Cn=Dn(1+o(1)); since the relative errors tend to 0, An2∼Bn2 and CnAn∼DnBn. So reading the ≈'s above as ∼ is legitimate.
Dividing gives 2πn4πn⋅n2n(2n)2n=πn1⋅4n. (Stirling's formula itself is assumed.)