3

I am trying to approximate the following $$ c_{n,k}=\frac{n!}{(n-k)!n^k} $$ with $n \gg 2k$, however, my approximated value differs from the one provided by Mathematica for some arbitrary values I have picked. I tried some ideas, but they do not seem to work. First,

$$c_{n,k}=\frac{n!}{(n-k)!n^k}={n \choose k}\cdot\frac{k!}{n^k},$$ also $$\left(\frac{n}{k}\right)^k\leq {n \choose k} \leq \left(\frac{n e}{k}\right)^k \Leftrightarrow \left(\frac{n}{k}\right)^k\frac{k!}{n^k}\leq c_{n,k} \leq \left(\frac{n e}{k}\right)^k\frac{k!}{n^k}$$ so

$$\frac{k!}{k^k}\leq c_{n,k} \leq e^k\frac{k!}{k^k}$$ and taking logs $$\log\left(\frac{k!}{k^k}\right)\leq \log c_{n,k} \leq \log\left(e^k\frac{k!}{k^k}\right)=k\log e +\log\left(\frac{k!}{k^k}\right)$$

but, via Stirling ($k$ is not "big" so not a very good estimate), $$ \log\left(\frac{k!}{k^k}\right)=\log(k!)-\log(k^k)\sim k\log(k)-k\log(k)=0 $$

which leads nowhere. Even applying Stirling directly from the start and then using some manipulations, does not lead me anywhere.

$$ n!\sim \sqrt{2\pi n} n^n e^{-n}\qquad \text{and}\qquad (n-k)!\sim \sqrt{2\pi (n-k)} (n-k)^{n-k} e^{-n}e^{k} $$ and plugging in

$$c_{n,k}\sim\frac{\sqrt{2\pi n} n^n e^{-n}}{\sqrt{2\pi (n-k)} (n-k)^{n-k} e^{-n}e^{k}n^k}=\sqrt{\frac{n}{n-k}}\left(\frac{n}{n-k}\right)^{n-k}e^{-k}$$

but, $n \gg k$,so $$\left(\frac{n}{n-k}\right)^{n}\to e^k\qquad \text{as}\qquad n\to\infty$$ yielding

$$c_{n,k}\sim \left(\frac{n}{n-k}\right)^{\frac{1}{2}-k}.$$

However, considering $n=2\cdot 10^6$ and $k=10^3$, I obtain $0.778963$ from Mathematica and $0.606606$ from the latter method. Interestingly, using the approximation $$ \left(\frac{n}{n-k}\right)^{\frac{1}{2}(1-k)}. $$ gets much closer to a value of $0.778947$.

kiyomi
  • 1,434
  • Of course the last result mentioned may be found by writing

    $$\sqrt{\frac{n}{n-k}}\left(\frac{n}{n-k}\right)^{n-k}e^{-k} =\left(\frac{n}{n-k}\right)^{\frac12-\frac{k}2} \left(\frac{n}{n-k}\right)^{n-\frac{k}2}e^{-k}$$

    and using

    $$\left(\frac{n}{n-k}\right)^{n-\frac{k}{2}}\sim e^k$$

    but this is achieved a posteriori and does not give insight into why I should specifically keep $k/2$.

    – kiyomi Apr 28 '23 at 21:22

2 Answers2

2

First, we approximate $\ln c_{n,k}$. Using $\ln (1-x)\approx-x$, which is valid when $x$ is close to zero, $$ \ln\left(\frac{n!}{(n-k)!n^k}\right) =\ln\left(\frac{n}{n}\cdot\frac{n-1}n\cdots \frac{n-k+1}{n}\right) =\sum_{i=0}^{k-1}\ln \left(1-\frac{i}{n}\right)\approx -\sum_{i=0}^{k-1}\frac{i}n=\frac{k(k-1)}{2n}. $$ Therefore, $$ \frac{n!}{(n-k)!n^k}\approx \exp\left(-\frac{k(k-1)}{2n}\right). $$ This should work well as long as $k$ is small compared to $n$.

Mike Earnest
  • 84,902
2

$$c_{n,k}=\frac{n!}{(n-k)!\,\,n^k}=\frac{ \Gamma (n+1)}{\Gamma (n-k+1)\,\,n^k}$$

Let $k= an$, take logarithms, use Stirling approximation twice and finish with Taylor series to obtain $$\color{red}{\log(c_{n,an})= ((a-1) \log (1-a)-a)\,n-\frac{1}{2} \log (1-a)+}$$ $$\color{red}{\frac a{12}\, \sum_{i=0}^\infty (-1)^{i+1} \, \frac {P_i(a)}{\alpha_i}\, m^{2i+1}}\qquad \text{where}\qquad \color{blue}{m=\frac{1}{(1-a)\, n}}$$

$$\left( \begin{array}{ccc} i & \alpha_i & P_i(a) \\ 0 & 1 & 1 \\ 1 & 30 & a^2-3 a+3 \\ 2 & 105 & a^4-5 a^3+10 a^2-10 a+5 \\ 3 & 140 & a^6-7 a^5+21 a^4-35 a^3+35 a^2-21 a+7 \\ 4 & 99 & a^8-9 a^7+36 a^6-84 a^5+126 a^4-126 a^3+84 a^2-36 a+9 \\ \end{array} \right)$$

I suggest you stay with this and exponentiate the result at the end.

The relative error is given by the first neglected term.

For your working case $n=2\times 10^6$ and $a=5\times 10^{-4}$, I give below the difference between the exact and approximate values as a function of $i$. $$\left( \begin{array}{ccc} i & \text{error} \\ 0 & 4.061 \times 10^{-25} \\ 1 & 4.837 \times 10^{-38} \\ 2 & 1.270 \times 10^{-50} \\ 3 & 5.777 \times 10^{-63} \\ 4 & 4.023 \times 10^{-75} \\ \end{array} \right)$$