why $\ln(n!)=n\ln(n)-n+\frac{1}{2}\ln(2\pi n)+o(1)$?

71 Views Asked by At

I know that $$n!\sim_\infty \left(\frac{n}{e}\right)^n\sqrt{2\pi n},$$ and thus $$\ln(n!)\sim_\infty \ln\left\{\left(\frac{n}{e}\right)^n\sqrt{2\pi n}\right\}.\tag{*}$$

But why does it implies $$\ln(n!)=n\ln(n)-n+\frac{1}{2}\ln(2\pi n)+o(1) \ \ ?$$

For me $(*)$ gives us $$\ln(n!)=n\ln(n)-n+\frac{1}{2}\ln(2\pi n)+o\left(\ln\left\{\left(\frac{n}{e}\right)^n\sqrt{2\pi n}\right\}\right),$$ and since $$\lim_{n\to \infty }\ln\left\{\left(\frac{n}{e}\right)^n\sqrt{2\pi n}\right\}\neq 0,$$ why do we have this $o(1)$ at the end ?

3

There are 3 best solutions below

1
On BEST ANSWER

Your calculus is incorrect. The asymptotic equality $f(n)\sim g(n)$ is equivalent to $f(n)= g(n)\cdot (1+o(1))$. Taking logarithm yields the equivalent condition $\log f(n) = \log g(n) + \log (1+o(1))$. To finish the proof, note that $\log (1+o(1))= o(1)$. So to sum up: $\log f(n) = \log g(n) + o(1)$.

0
On

Taking the logarithm on both sides of $n!\sim_\infty \left(\frac{n}{e}\right)^n\sqrt{2\pi n}$ and keeping the $\sim_\infty$ is an awful waste of information.

$\sim_\infty$ means that the ratio between the expressions on either side goes to $1$ as $n\to\infty$. That means that the difference between the logarithm of the two terms goes to $0$, which is much stronger (at least since the terms both go to $\infty$). That's exactly $o(1)$.

0
On

The original asymptote is stronger than you think it is; $\sim$ means the expressions on either side have a ratio of the form $1+o(1)$. In fact, one can prove $n!$ is exactly the usual approximation for it multiplied by a Taylor series in $1/n$; the result is called the Stirling series.