Stirling's Formula

Theorem
The factorial function can be approximated by the formula:
 * $\displaystyle n! \sim \sqrt {2 \pi} n^n n^{1/2} e^{-n} = \sqrt {2 \pi n} \left({\frac {n} {e}}\right)^n$

where $\sim$ denotes asymptotically equal.

Proof
Consider the sequence $\left \langle {d_n} \right \rangle$ defined as $\displaystyle d_n = \ln \left({n!}\right) - \left({n + \frac 1 2}\right) \ln n + n$.

What we want to do is show that $\left \langle {d_n} \right \rangle$ is decreasing.

So we examine the sign of $d_n - d_{n+1}$.

It is otherwise known as Stirling's approximation.