Why is $n!$ so close to linear when plotted on a log scale

asymptoticsfactorialgraphing-functionslogarithms

I was considering the speed at which the factorial function grows, and thought to graph the function on a log scale. I noticed something interesting – it seems to approach a line.

I graphed $f(x) = \ln{x!}$ on Desmos, both with and without a tangent line approximation at $x=100$, and got the following graphs:

Without tangent lineWith tangent line

Although obviously the factorial function diverges as we approach the capacity of Desmos's calculation, notice that the linear model works quite well. I'm wondering if there's anything special about the factorial function that causes it to resemble a line when plotted on a log scale.

Best Answer

In a sense, because a factorial is "locally exponential".

What does this mean? Factorials satisfy the recurrence relation

$$(n + 1)! = (n + 1) \cdot n!$$

while exponentials satisfy

$$b^{n + 1} = b \cdot b^n$$

for a given base $b$. Now suppose we have an $n$ that's pretty large. Then $n + 1 \approx n$. Then we have that

$$(n + 1)! \approx n \cdot n!$$

which is similar to the base-$n$ exponential's recurrence, i.e.

$$n^{n+1} = n \cdot n^n$$

In particular, we can even go out some number $k$ of increments in the same way, provided that $k$ is not too big, to get:

$$(n + k)! \approx n^k \cdot n!$$

Hence, over a range of $k$ not so large that any of them are comparable to $n$, $k \mapsto (n + k)!$ is approximately an exponential function! And thus if you plot $y = (n + x)!$ with a large $n$ and not too large range of $x$, you will get an approximately exponential curve, which then becomes likewise approximately linear in the logarithmic plot.