TITLE: Proof that $\pi =\lim_{n\to\infty}\frac{2^{4n}n!^4}{n(2n)!^2}$
QUESTION [7 upvotes]: In this post, the symbol $\sim$ means asymptotically equivalent.
The relationship between $\pi$ and factorials hinges on Stirling's formula:
$$n!\sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n\implies n!^2\sim 2\pi n\left(\frac{n}{e}\right)^{2n}.$$
In a similar manner,
$$(2n)!\sim \sqrt{4\pi n}\left(\frac{2n}{e}\right)^{2n}.$$
Then, by taking the ratio of the two quantities and simplifying one gets
$$\frac{(2n)!}{n!^2}\sim \frac{2^{2n}}{\sqrt{\pi n}}.$$
By squaring both sides and further manipulation:
$$\pi =\lim_{n\to\infty}\frac{2^{4n}n!^4}{n(2n)!^2}.$$
Also, note that the last limit for $\pi$ above and
$$\frac{n!^2}{2n}\left(\frac{e}{n}\right)^{2n}$$
(which can be obtained as a limit for $\pi$ from Stirling's formula dircetly) have a different rate of convergence.
My question is, how can one justify the manipulations (e.g. squaring both sides) when the expressions are not equivalent but only asymptotically equivalent? When I used this I ran into problems:
$$\ln n!\sim n\ln n-n\, \text{(true)},$$
$$n!\sim e^{n\ln n-n}\, \text{(false)}.$$

REPLY [4 votes]: The asymptotic equality $e^{f(n)} \sim e^{g(n)}$ means 
$$
\frac{{e^{f(n)} }}{{e^{g(n)} }}\to 1 \Leftrightarrow  e^{f(n) - g(n)}  \to 1 \Leftrightarrow f(n) - g(n) \to 0.
$$
But $f(n) \sim g(n)$ does not necessarily imply that the difference of the two sides tend to $0$ (or even that it is bounded). Thus $f(n) \sim g(n) \not\Rightarrow  e^{f(n)} \sim e^{g(n)}$. If, for example, $g(n)$ is evetually non-zero, then the reverse implication is true.
In your example
$$
\log n! - (n\log n - n) = \frac{1}{2}\log (2\pi n) + \mathcal{O}\!\left( {\frac{1}{n}} \right)
$$
which is not bounded.