# Some questions regarding the motivation and use of Stirling's formula

For a while I've been looking for a proof of Stirling's formula and after recently asking about it here and reading about it here, I finally found a proof that wasn't too difficult here. I've got a few questions regarding this formula.

The proof I settled for was not particularly pretty in the sense that it all boiled down to cumbersome verifications of equalities and inequalities. In addition to that it didn't provide an intuitive motivation for why the formula ought to be correct. So without the necessity of rigour, how does one provide a motivation for why the formula ought to be correct?

A while ago I asked a question regarding asymptotic functions and their interchangeability when calculating limits here. I see now that either the answer I got was insufficient or I misunderstood it because I was left with the impression that $n!$ could be replaced by Stirling's formula whenever the limit of some fraction was computed. However, given that $e=\lim_{n\to\infty}n/(n!)^{\frac{1}{n}}$ we have that $n!\sim\left(\frac{n}{e}\right)^n$. So $$\lim_{n\to\infty}\frac{1}{\sqrt{2\pi n}} = \lim_{n\to\infty}\frac{1}{\sqrt{2\pi n}}\frac{n!}{n!} = \lim_{n\to\infty}\frac{1}{\sqrt{2\pi n}}\frac{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n}{\left(\frac{n}{e}\right)^n} = 1$$ which is evidently incorrect. So under what conditions can I replace $n!$ with Stirling's formula and other functions with such asymptotic properties? This is important to know because otherwise I might end up with nonsense like I did above but in a bit less evident situations. Can I only ever replace all $n!$ with one particular function that is asymptotically equal to it? How does one prove something like that?

• You might want to read Terry Tao's discussion for more motivation/explanation of the derivation of Stirling's formula. Jan 7, 2017 at 17:14
• You wrote "However … . So … , which is evidently incorrect." I do not understand what you are saying there.
– zhw.
Jan 7, 2017 at 17:32
• @zhw I use Stirlings formula and the expression I got from the e limit and then I replace the $n!/n!$ in the incorrect calculation by both these asymptotic formulas and acquired a nonsense result. Jan 7, 2017 at 17:42
• Since you've asked two questions here, and had (and accepted) a good answer to one of them, you might want to consider asking another question about motivating Stirling's formula. Jan 7, 2017 at 18:44
• @Chappers I got the most important question answered and I found a somewhat sufficient motivation elsewhere. Jan 7, 2017 at 18:55

You are correct that Stirling is sometimes used to yield answers without full justification.

Let's review: The expression "$a_n \sim b_n$ as $n\to \infty$" means

$$\lim_{n\to \infty} \frac{a_n}{b_n} = 1.$$

That's it, no more, no less. So Stirling says

$$\lim_{n\to \infty}\frac{n!}{(n/e)^n\sqrt {2\pi n}} = 1.$$

Another way of putting it is

$$\tag 1 n!= (n/e)^n\sqrt {2\pi n}\cdot c_n,\,\text { where } c_n \to 1.$$

$(1)$ is what I always use when I apply Stirling to get at some other limit. For example,

$$\tag 2\frac{n}{(n!)^{1/n}} = \frac{n}{[(n/e)^n\sqrt {2\pi n}\,c_n]^{1/n}} = \frac{e}{(\sqrt {2\pi n}\, c_n)^{1/n}}.$$

One still needs to verify that $(\sqrt {2\pi n}\,c_n)^{1/n} \to 1$ to see $(2)\to e!$ That is the kind of justification you sometimes see left out when someone is using Stirling.

• I like your method, thank you very much. Jan 7, 2017 at 18:02

It is true that $n/n!^{1/n}$ converges to $e$ but false that $n!\sim (n/e)^n.$ It appears that you assumed that $1=\lim_{n\to \infty} n/en!^{1/n}$ implies $1= \lim_{n\to \infty}(n/en!^{1/n})^n=\lim_{n\to \infty}n^n/e^nn!.$

It is not true that $\lim_{n\to \infty}f(n)=1$ implies $\lim_{n\to \infty}f(n)^n=1.$

Examples:(i) $f(n)=1+1/n.$ Then $f(n)^n\to e$. (ii).$f(n)=1+1/\sqrt n.$ Then $f(n)^n\to \infty.$

Check Stirling's formula: $n!\sim (n/e)^n\sqrt {2\pi n}.$ This implies $n!^{1/n}\sim (n/e) (2\pi n)^{1/2n} \sim (n/e)^n$ but the implication is one-way.

• So essentially this is yet another example of $\infty$ causing trouble when taken for granted. This is a good lesson for me, thank you. Jan 7, 2017 at 17:59
• It is fairly easy to show there exists $k$ such that $n!\sim (n/e)^n\sqrt {kn}$ but showing that $k=2\pi$ is more difficult. Basically you need the Wallis Product For $\pi.$ Jan 7, 2017 at 18:04
• @David Right, they are skimpy on the justification there. It may be that they expect the reader to have some experience, and glossed over it. If you use the sequence $c_n$ as in my answer, it works out fine.
– zhw.
Jan 7, 2017 at 18:36
• Yeah I figured that out, thank you very much. Jan 7, 2017 at 18:37