Approximation of factorial numbers using partial Stirling’s approximation

approximationfactorial

In the question link, one of the comments mentioned that $4 \cdot e \approx 10$, and indeed, $4^{9} < 9!$ according to Stirling's approximation. In other words, $9$ is very close to $\left\lfloor 4 \cdot e \right\rfloor$.

However, Stirling's approximation function is $ n! \sim \sqrt{2\pi n}\cdot \left( \frac{n}{e} \right)^{n}$ and not just $\left\lfloor n \cdot e \right\rfloor$

If it's $1000000 \cdot e$, the first value that satisfies the condition $1000000^{n} < n!$ is $2718274$, whereas $1000000 \cdot e = 2718282$

In other words, only 8 numbers below the result $2718282$, which is a quite satisfactory approximation.

I would like to know why $x\cdot e$ provides such a good approximation to satisfy the condition $z^{n} < n!$ considering that $z \cdot e \approx n!$ ?

Best Answer

There are several Stirling's approximations. The crudest one is $n! \approx \left( \frac{n}{e} \right)^{n}$, a more precise one is $n! \approx \left( \frac{n}{e} \right)^{n} \sqrt{2\pi n} $.

If we want to solve (approximately) $ z^n = n!$ for $n$, and we consider the first approximation acceptable, then we readily conclude $z \approx n/e$ or $ n \approx e\, z$.

That gives only a first order approximation, which is enough in some cases (as seems to be the case). If we add the $\sqrt{2\pi n}$ factor, we'd get a more precise value (but we cannot solve explicitly for $n$).

For example, taking values of $z$ that give an integer $n$: $$ \begin{array}{c|c|c|} z & n & n_0 & n_1 \\ \hline 4.147 & 9 & 11.27 & 9.011 \\ \hline 8.304 & 20 & 22.57 & 20.01 \\ \hline \end{array} $$

Here $n$ is the exact value, $n_0=e z$ is the first order approximation and $n_1$ is given by the finer approximation.