Stirling's Formula/Refinement
Jump to navigation
Jump to search
Theorem
A refinement of Stirling's Formula is:
- $n! = \sqrt {2 \pi n} \paren {\dfrac n e}^n \paren {1 + \dfrac 1 {12 n} + \map \OO {\dfrac 1 {n^2} } }$
where $\map \OO \cdot$ is the big-$\OO$ notation.
Proof
We have:
- $\forall x \in \closedint 0 1 : \dfrac {x^2} 2 \le e^x - \paren {1 + x} \le e x^2$
since:
\(\ds \dfrac {x^2} 2\) | \(=\) | \(\ds x^2 \sum_{k \mathop \ge 0} \dfrac {0^k} {\paren {k + 2} !}\) | ||||||||||||
\(\text {(1)}: \quad\) | \(\ds \) | \(\le\) | \(\ds x^2 \sum_{k \mathop \ge 0} \dfrac {x^k} {\paren {k + 2} !}\) | |||||||||||
\(\ds \) | \(=\) | \(\ds x^2 \sum_{k \mathop \ge 0} \dfrac {x^k} {\paren {k + 2}!}\) | ||||||||||||
\(\ds \) | \(=\) | \(\ds \sum_{k \mathop \ge 2} \dfrac {x^k } {k !}\) | ||||||||||||
\(\ds \) | \(=\) | \(\ds e^x - \paren {1 + x}\) | Taylor Series Expansion for Exponential Function | |||||||||||
\(\ds \) | \(=\) | \(\ds x^2 \sum_{k \mathop \ge 0} \dfrac {1^k} {\paren {k + 2}!}\) | see $\paren 1$ | |||||||||||
\(\ds \) | \(\le\) | \(\ds e x^2\) |
Thus the claim follows from Limit of Error in Stirling's Formula:
- $e^{1 / \paren {12 n + 1} } \le \dfrac {n!} {\sqrt {2 \pi n} n^n e^{-n} } \le e^{1 / 12 n}$
$\blacksquare$
Examples
Factorial of $8$
The factorial of $8$ is given by the refinement to Stirling's formula as:
- $8! \approx 40 \, 318$
which shows an error of about $0.005 \%$.
Source of Name
This entry was named for James Stirling.
Sources
- 1997: Donald E. Knuth: The Art of Computer Programming: Volume 1: Fundamental Algorithms (3rd ed.) ... (previous) ... (next): $\S 1.2.5$: Permutations and Factorials: Exercise $5$