4

In this answer there is a claim that $$\frac{n!}{(n-k)! n^k} \approx e^{-\frac{k^2}{2n}} \tag{1}$$ which is then used to approximate the sum over $k=1,\ldots, n$ via $$\sum_{k=1}^n \frac{n!}{(n-k)! n^k} \approx \sum_{k=1}^n e^{-\frac{k^2}{2n}} \approx \int_0^n e^{-\frac{t^2}{2n}} \, dt \approx \sqrt{\pi n /2}.$$

How is the approximation (1) obtained?


I attempted to use Stirling's inequality and some hand-wavey approximations:

$$\frac{n!}{(n-k)! n^k} \sim \frac{n^{n+1/2}/e^n}{((n-k)^{n-k+1/2}/e^{n-k}) \cdot n^k} = e^{-k}\left(1-\frac{k}{n}\right)^{-(n-k+1/2)} \sim e^{-k} e^{\frac{n-k+1/2}{n/k}} = e^{-\frac{k^2}{n}+\frac{k}{2n}}.$$

Besides getting the wrong asymptotics, I also recognize that this approximation only works well when $k$ is small compared to $n$, but in the above application we are considering $k$ close to $n$ as well.

angryavian
  • 93,534

1 Answers1

5

Here is how $(1)$ is obtained in the regime where $k$ is small compared to $n$. First, take logs, and use $\log(1-x)=-x+O(x^2)$. \begin{align} \log\frac{n!}{(n-k)!n^k} &= \sum_{i=0}^{k-1}\log\left(1-\frac in\right) \\&= \sum_{i=0}^{k-1}\left(-\frac{i}{n}+O\Big(\frac{i^2}{n^2}\Big)\right) \\&= -\frac{k(k-1)}{2n}+O\Big(\frac {k^3}{n^2}\Big) \end{align} Exponentiating, we get $$ \frac{n!}{(n-k)!n^k}\approx \exp\left(\frac{-k^2}{2n}+O\Big(\frac {k^3}{n^2}\Big)\right) $$ In the regime where $k=o(n^{2/3})$, the above becomes $\exp(-k^2/2n +o(1))$, which means that the approximation of $\exp(-k^2/2n)$ is good as $n\to\infty$.

Suppose instead that $k$ is large, by which I mean $k\ge Cn^{2/3}$. Here, we need to be a little more careful. We use the inequality $\log(1-x)\le -x$ to get an inequality for $n!/(n-k)!n^k$, instead of a big-Oh approximation. The result is $$ \frac{n!}{(n-k)!n^k}\le \exp\left(-\frac{k(k-1)}{2n}\right) \approx \exp\left(-\frac{k^2}{2n}\right)\le \exp\left(-\frac{(Cn^{2/3})^2}{2n}\right) =\exp(-(C^2/2)n^{1/3}) $$ This shows that both the exact answer and the approximation are approximately zero, which means that the approximation is good.


I finally figured out your error. The problem is this step. You claim that $$ \left(1-\frac{k}{n}\right)^{-(n-k+1/2)}=\left[\left(1-\frac1{n/k}\right)^{-n/k}\right]^{\frac{n-k+1/2}{n/k}} \stackrel{\color{red}{\text{error}}}{\sim} e^{\frac{n-k+1/2}{n/k}} $$ You seem to using the following false lemma:

False Lemma: Let $a_n,b_n,c_n$ be positive sequences. Suppose that $a_n\sim b_n$ as $n\to \infty$. Then $(a_n)^{c_n} \sim (b_n)^{c_n}$ as $n\to\infty$.

You are applying this with $a_n=(1-\frac1{n/k})^{-n/k}$, $b_n=e$, and $c_n=\frac{n-k+1/2}{n/k}$, where we are thinking of $k=k(n)$ as a function of $n$.

To see why this lemma is false, take $a_n=1+1/n$, $b_n=1$, and $c_n=n$.

Mike Earnest
  • 84,902