15

How can you compute the asymptotics of

$$S=n + m - \sum_{k=1}^{n} k^{k-1} \binom{n}{k} \frac{(n-k)^{n+m-k}}{n^{n+m-1}}\;?$$

We have that $n \geq m$ and $n,m \geq 1$.

A simple application of Stirling's approximation gives

$$S \approx T = n + m - \frac{n^{3/2-m}}{\sqrt{2\pi}} \sum_{k=1}^n \frac{(n-k)^{m-1/2}}{k^{3/2}}$$

A more accurate approximation is given by

$$n+m- \frac{\left(1+\frac{1}{12 n}\right) n }{\sqrt{2 \pi }} \sum _{k=1}^{n-1} \frac{ (1-\frac{k}{n})^{m-\frac{1}{2}}}{\left(1+\frac{1}{12 k}\right) k^{3/2} \left(1+\frac{1}{12 (n-k)}\right) }$$

Via an indirect and handy wavy argument, my guess is guess for constant $m$ is that the answer is

$$S \sim \sqrt{2n} \frac{\Gamma(m+\frac{1}{2})}{(m-1)!}$$

Update. When $m$ grows almost as quickly as $n$ I think my guess is an underestimate. For example when $n=m$ it seems numerically that $S \sim 1.841 n$ and in fact if $n=m$ then it is suggested that $S \sim n\left(2-\left( -W\left(-\frac{1}{\mathrm{e}^2}\right)\right)\right)$ (see Is $\sum_{k=1}^{n} k^{k-1} (n-k)^{2n-k} \binom{n}{k} \sim\frac{n^{2n}}{2\pi} $?).

Update 2. When $m=1$ then $S$ is precisely the average number of people required to find a pair with the same birthday. This is solved at the wikipedia entry for the Birthday Problem and so $S \sim \sqrt{\frac{\pi n}{2}}$ (which equals my guess above). I would however ideally like to find the asymptotics in terms of $m$ and $n$ without assuming that $m$ is fixed.

Update 3. For the $m=1$ case we can prove that the correct asymptotics is $\sqrt{\frac{\pi n}{2}}$ in two ways.

  • We will first show the result using the following identity.

$$n + 1 - \sum_{k=1}^{n} k^{k-1} \binom{n}{k} \frac{(n-k)^{n+1-k}}{n^{n+1-1}}=1 + \sum_{k=1}^n \frac{n!}{(n-k)!n^k} = 1+Q(n)$$

The numerator of the sum on the left is $n^{n+1}-Q(n)n^n$ (Q(n) is called Ramanujan's function by Knuth) according to A219706 and A063169. This immediately gives the identity.

We also know that $Q(n) \sim \sqrt{\frac{\pi n}{2}}$ from the wikipedia (is there a better reference?).

  • The second proof follows from the amazing answer of GEdgar where he shows that

$$\sum_{k=1}^n \binom{n}{k} k^{k-1}(n-k)^{n-k+1} = n^n\Bigg( n -\frac{\sqrt{2\pi}}{2} n^{1/2} + \frac{1}{3} -\frac{\sqrt{2\pi}}{24} n^{-1/2} +\frac{4}{135}n^{-1} -\frac{\sqrt{2\pi}}{576}n^{-3/2} +O\left(n^{-2}\right)\Bigg) $$

  • 2
    How did you get this answer? – Mhenni Benghorbal Apr 14 '13 at 18:02
  • check your question for typos, because the answer you've come up with is pretty far off if the question is as stated. – Jonathan Apr 14 '13 at 18:24
  • 1
    What is the relative size of $m$ and $n$? – Greg Martin Apr 14 '13 at 19:10
  • Numerics for fixed $m$ suggest that your conjectured constant is not accurate. For $m=1$ the actual values of $S/\sqrt{2n}$ quickly descend below $1$ and seem smoothly decreasing as $n$ increases. For fixed $m\ge2$, the value of $S/\sqrt{2n}$ is also smoothly decreasing as $n$ increases, but they don't seem like they will get down to $\Gamma((m+1)/2)/\Gamma(m)$. – Greg Martin Apr 15 '13 at 00:20
  • What is the context? Do you have any empirical evidence for your claim? – Aryabhata Apr 15 '13 at 06:00
  • @GregMartin There was another typo (fixed). The numerator was meant to be $\Gamma(m+1/2)$ –  Apr 15 '13 at 06:01
  • 1
    Have you tried using the following?

    $$ n^n = \dfrac{n! e^{n-\lambda_n}}{\sqrt{2\pi n}}$$

    where $\frac{1}{12n+1} \lt \lambda_n \lt \frac{1}{12n}$

    – Aryabhata Apr 15 '13 at 07:42
  • @Aryabhata Not successfully. Do you see a way to get the answer that way? –  Apr 15 '13 at 17:40
  • @motl737: For $m=1/2$ at least, it might work (you might also have to use Euler-McLaurin Summation formula). But,I seem to get something different from what you have, but it is a bit complicated and error-prone, so I need to recheck. I might post it sometime today, if I confirm the correctness. – Aryabhata Apr 15 '13 at 17:52
  • 1
    Here is another idea: The power series for $\dfrac{1}{1+W(-z)} -1$ is $\sum_{n=1}^{\infty} \frac{n^n z^n}{n!}$ (for $|z| \lt 1/e$). Taking the square gives you coefficients similar to what you want (at least the binomial summation part). So you need to estimate the $n^{th}$ derivative of that. See J.M.'s answer here: http://math.stackexchange.com/a/352204/1102 (and the question itself is closely related). – Aryabhata Apr 15 '13 at 18:50
  • Is the $-$ in $S$ correct? Because then $S$ would be negative, and certainly smaller than your given large formula in $n$ and $m$. – TMM Apr 16 '13 at 18:10
  • @TMM $S$ can't be negative far as I know. What do you mean? I just tested it by computer as well. –  Apr 16 '13 at 18:43
  • Are you saying the sum is always less than $n + m$? – TMM Apr 16 '13 at 19:39
  • @TMM Yes. I believe so. At least for $n \geq m$. –  Apr 16 '13 at 19:49
  • For fixed $m$ positive integer we do have $S \sim \sqrt{2n} \frac{\Gamma(m+\frac{1}{2})}{(m-1)!}$ from the same method as in http://math.stackexchange.com/a/365972/442 – GEdgar Apr 19 '13 at 13:21

2 Answers2

8

My first answer showed that small $k$ play a major role in the sum. Since Stirling is an asymptotic approximation, the approximation for small $k$ was not be good enough. My second answer showed that Stirling should be used for $n!$ and $(n-k)!$ since they will be large. My third approach overvalued $\left(1-\frac{k}{n}\right)^{m-1/2}$. This approach uses the series for the Lambert W function given in $(9)$ and approximations given in $(10)$. $$ \begin{align} &\sum_{k=1}^nk^{k-1}\binom{n}{k}\frac{(n-k)^{n+m-k}}{n^{n+m-1}}\\ &=\sum_{k=1}^n\left(1+O\left(\frac{k}{n^2}\right)\right)\frac{n^{n+1/2}}{(n-k)^{n-k+1/2}}\frac{k^{k-1}}{k!\,e^k}\frac{(n-k)^{n+m-k}}{n^{n+m-1}}\\ &=n\sum_{k=1}^n\left(1+O\left(\frac{k}{n^2}\right)\right)\frac{k^{k-1}}{k!\,e^k}\left(1-\frac{k}{n}\right)^{m-1/2}\tag{11} \end{align} $$ If we let $\alpha=\dfrac{m-1/2}{n}$, then $\left(1-\dfrac{k}{n}\right)^{m-1/2}\le e^{-k\alpha}$. Therefore, using the approximation for $\mathrm{W}'(x)$ given in $(10)$, we get $$ \begin{align} n\sum_{k=1}^n\frac{k}{n^2}\frac{k^{k-1}}{k!\,e^k}\left(1-\frac{k}{n}\right)^{m-1/2} &\le\frac1n\sum_{k=1}^nk\frac{k^{k-1}}{k!\,e^{k(1+\alpha)}}\\ &=\frac1n\mathrm{W}'(-e^{-1-\alpha})\\ &\le\frac1n\frac{e^2}{\sqrt{2\alpha}}\\ &=\frac{e^2}{\sqrt{(2m-1)n}}\tag{12} \end{align} $$ Thus, the big-O term in $(11)$ is insignificant. Using the series for $\mathrm{W}(x)$ from $(9)$ and remembering that $\mathrm{W}(-1/e)=-1$ $$ \begin{align} n\sum_{k=1}^n\frac{k^{k-1}}{k!\,e^k}\left(1-\frac{k}{n}\right)^{m-1/2} &=n\sum_{k=1}^n\frac{k^{k-1}}{k!\,e^k}\\ &-n\sum_{k=1}^n\frac{k^{k-1}}{k!\,e^k}\left(1-\left(1-\frac{k}{n}\right)^{m-1/2}\right)\\ &=n-n\sum_{k=n+1}^\infty\frac{k^{k-1}}{k!\,e^k}\\ &-n\sum_{k=1}^n\frac{k^{k-1}}{k!\,e^k}\left(1-\left(1-\frac{k}{n}\right)^{m-1/2}\right)\tag{13} \end{align} $$ Now we can use Stirling to approximate $\dfrac{k^{k-1}}{k!\,e^k}=\dfrac{k^{-3/2}}{\sqrt{2\pi}} +O\left(k^{-5/2}\right)$.

First, we evaluate the tail from the first sum in $(13)$ $$ \begin{align} n\sum_{k=n+1}^\infty\frac{k^{k-1}}{k!\,e^k} &=n\sum_{k=n+1}^\infty\left(\frac{k^{-3/2}}{\sqrt{2\pi}}+O\left(k^{-5/2}\right)\right)\\[6pt] &=\frac{2\,n^{1/2}}{\sqrt{2\pi}}+O\left(n^{-1/2}\right)\tag{14} \end{align} $$ Next, the error term in the second sum in $(13)$ $$ \begin{align} &n\sum_{k=1}^nk^{-5/2}\left(1-\left(1-\frac{k}{n}\right)^{m-1/2}\right)\\ &\le\left(\sum_{n=1}^\infty k^{-3/2}\right) \,\sup_k\left\{\frac{n}{k}\left(1-\left(1-\frac{k}{n}\right)^{m-1/2}\right)\right\}\\[6pt] &\le\zeta(3/2)(m-1/2)\tag{15} \end{align} $$ Finally, the main term in the second sum in $(13)$ is a Riemann Sum in disguise $$ \begin{align} &n\sum_{k=1}^n\dfrac{k^{-3/2}}{\sqrt{2\pi}}\left(1-\left(1-\frac{k}{n}\right)^{m-1/2}\right)\\ &=\frac{n^{1/2}}{\sqrt{2\pi}}\sum_{k=1}^n\left(\frac{k}{n}\right)^{-3/2}\left(1-\left(1-\frac{k}{n}\right)^{m-1/2}\right)\frac1n\\ &\sim\frac{n^{1/2}}{\sqrt{2\pi}}\int_0^1x^{-3/2}\left(1-(1-x)^{m-1/2}\right)\,\mathrm{d}x\\ &=\frac{2\,n^{1/2}}{\sqrt{2\pi}}\int_0^{\pi/2}\frac{\cos(u)-\cos^{2m}(u)}{\sin^2(u)}\,\mathrm{d}u\\ &=\frac{2\,n^{1/2}}{\sqrt{2\pi}}\int_0^{\pi/2}\left(-1+\sum_{k=0}^{2m-1}\cos^k(u)\right)\frac{\mathrm{d}u}{1+\cos(u)}\\ &=\frac{2\,n^{1/2}}{\sqrt{2\pi}}\int_0^{\pi/2}\left(-\frac1{1+\cos(u)}+\sum_{k=0}^{m-1}\cos^{2k}(u)\right)\,\mathrm{d}u\\ &=-\frac{2n^{1/2}}{\sqrt{2\pi}}+\frac{2\,n^{1/2}}{\sqrt{2\pi}}\sum_{k=0}^{m-1}\int_0^{\pi/2}\cos^{2k}(u)\,\mathrm{d}u\\ &=-\frac{2n^{1/2}}{\sqrt{2\pi}}+\frac{2\,n^{1/2}}{\sqrt{2\pi}}\sum_{k=0}^{m-1}\frac\pi2\frac1{4^k}\binom{2k}{k}\\ &=-\frac{2n^{1/2}}{\sqrt{2\pi}}+\frac{\pi\,n^{1/2}}{\sqrt{2\pi}}\frac{2m}{4^m}\binom{2m}{m}\tag{16} \end{align} $$ The last step uses the identity $\displaystyle\sum_{k=0}^{m-1}\frac1{4^k}\binom{2k}{k}=\frac{2m}{4^m}\binom{2m}{m}$.

Putting together $(11)-(14)$ yields $$ n+m-\sum_{k=1}^nk^{k-1}\binom{n}{k}\frac{(n-k)^{n+m-k}}{n^{n+m-1}}=\sqrt{2\pi n}\frac{m}{4^m}\binom{2m}{m}+O(m-1/2)\tag{17} $$ Using Stirling to approximate $\dfrac1{4^m}\binom{2m}{m}\sim\dfrac1{\sqrt{\pi m}}$, $(17)$ gives, for large $m$, $$ n+m-\sum_{k=1}^nk^{k-1}\binom{n}{k}\frac{(n-k)^{n+m-k}}{n^{n+m-1}} \sim\sqrt{2mn}\tag{18} $$ as my earlier answers did.


Further Considerations

The case where $m=\alpha n$, for some constant $\alpha$, cannot be handled by $(17)$ since the error term is $O(m)=O(\alpha n)$ and that would be similar in size to $\sqrt{2mn}=\sqrt{2\alpha}n$. To handle this case, we start with the sum at the beginning of $(13)$ $$ \begin{align} n\sum_{k=1}^n\frac{k^{k-1}}{k!\,e^k}\left(1-\frac{k}{n}\right)^{m-1/2} &\sim n\sum_{k=1}^\infty\frac{k^{k-1}}{k!\,e^{k(1+\alpha)}}\\ &=-n\mathrm{W}(-e^{-1-\alpha}) \end{align} $$

Thus, $$ n+m-\sum_{k=1}^nk^{k-1}\binom{n}{k}\frac{(n-k)^{n+m-k}}{n^{n+m-1}} \sim n(1+\alpha+\mathrm{W}(-e^{-1-\alpha}))\tag{19} $$ For $m=n$, where $\alpha=1$, this is $n\left(2+\mathrm{W}(-e^{-2})\right)=n\,1.84140566043696063785$


Derivation of the series for $\mathrm{W}(x)$

Here is an identity we will use later $$ \begin{align} &\sum_{k=1}^{n-1}\binom{n-1}{k-1}k^{k-1}(n-k)^{n-k-1}\\ &=\sum_{k=1}^{n-1}\binom{n-1}{k-1}k^{k-1}\sum_{j=0}^{n-k-1}\binom{n-k-1}{j}n^{j}(-1)^{n-k-j-1}k^{n-k-j-1}\tag{1}\\ &=\sum_{j=0}^{n-2}n^{j}(-1)^{n-j-1}\sum_{k=1}^{n-j-1}\binom{n-1}{k-1}(-1)^k\binom{n-k-1}{j}k^{n-j-2}\tag{2}\\ &=\sum_{j=0}^{n-2}n^{j}(-1)^{n-j-1}\sum_{k=1}^{n-1}\binom{n-1}{k-1}(-1)^k\binom{n-k-1}{j}k^{n-j-2}\tag{3}\\ &=\sum_{j=0}^{n-2}n^{j}(-1)^{n-j-1}\binom{n-1}{n-1}(-1)^{n-1}\binom{-1}{j}n^{n-j-2}\tag{4}\\ &=(n-1)n^{n-2}\tag{5} \end{align} $$ $(1)$: binomial theorem

$(2)$: change order of summation

$(3)$: add terms where $\binom{n-k-1}{j}=0$

$(4)$: $\sum\limits_{k=1}^n\binom{n-1}{k-1}(-1)^k\binom{n-k-1}{j}k^{n-j-2}=0$ since $\binom{n-k-1}{j}k^{n-j-2}$ is a degree $n-2$ polynomial in $k$

$(5)$: each term in the sum was $n^{n-2}$


Taking the log-derivative of $we^w=x$ gives $\frac{w'}{w}+w'=\frac1x$ which yields the equation $$ w=w'(1+w)x\tag{6} $$ from which we will derive a recursion for the power series for $\mathrm{W}(x)$. Suppose that $$ \mathrm{W}(x)=\sum_{n=1}^\infty\frac{a_n}{n!}x^n\tag{7} $$ Using $we^w=x$ and equations $(6)$ and $(7)$, we get that $a_k$ satisfy $a_0=0$, $a_1=1$, and $$ \begin{align} \frac{a_n}{n!} &=n\frac{a_n}{n!} +\sum_{k=1}^{n-1}k\frac{a_k}{k!}\frac{a_{n-k}}{(n-k)!}\\ -(n-1)\,a_n &=\sum_{k=1}^{n-1}\binom{n}{k}k\,a_ka_{n-k}\\ &=\sum_{k=1}^{n-1}\binom{n-1}{k-1}n\,a_ka_{n-k}\\ a_n &=-\frac{n}{n-1}\sum_{k=1}^{n-1}\binom{n-1}{k-1}a_ka_{n-k}\tag{8} \end{align} $$ Putting together $(5)$ and $(8)$, we get that $$ \mathrm{W}(x)=\sum_{n=1}^\infty\frac{(-n)^{n-1}}{n!}x^n\tag{9} $$


Behavior of $\mathrm{W}(x)$ for $x\sim-1/e$

For $\alpha$ near $0$, $$ \begin{align} \mathrm{W}\left(-e^{-1-\alpha}\right) &\doteq-1+\sqrt{2\alpha}-\frac13\sqrt{2\alpha}^2+\frac7{36}\sqrt{2\alpha}^3\\ \mathrm{W}'\left(-e^{-1-\alpha}\right) &\doteq\frac{e^{1+\alpha}}{\sqrt{2\alpha}}\left(1-\frac23\sqrt{2\alpha}-\frac1{12}\sqrt{2\alpha}^2\right)\\ \mathrm{W}''\left(-e^{-1-\alpha}\right) &\doteq-\frac{e^{2+2\alpha}}{\sqrt{2\alpha}^3}\left(1-\frac{19}{12}\sqrt{2\alpha}^2\right) \end{align}\tag{10} $$

robjohn
  • 345,667
  • +1. I was getting something similar, but didn't trust my calculations... – Aryabhata Apr 17 '13 at 06:58
  • @robjohn I don't think this can be right. For $m=1$, $S$ is precisely the average number of people required to find a pair with the same birthday and hence $S \sim \sqrt{\frac{\pi n}{2}}$. I think my old guess might be correct for fixed $m$. –  Apr 17 '13 at 08:45
  • I was also hoping to find the asymptotics for $m$ growing with $n$ as well. –  Apr 17 '13 at 08:46
  • @motl737: I gave the asymptotic behavior for $\frac mn\sim\alpha$. I don't know if there is a reasonable formula for general $m$ and $n$. I have not found a closed form for $$ \sum_{k=1}^\infty\frac{e^{-k\alpha}}{k^{3/2}} $$ but the value for $\alpha=0$ is $\zeta(3/2)$. Mathematica defines this function as $\mathsf{PolyLog[3/2,Exp[-}\alpha\mathsf{]]}$. – robjohn Apr 17 '13 at 08:56
  • @robjohn Sorry if I am missing something simple but my first concern is that for $m=1$ and $n$ going to infinity (so $\alpha \rightarrow 0$) your answer doesn't seem right (maybe it is Stirling's approximation that is causing the problem). With respect to the sum, you can compute the integral to infinity if that helps at all. –  Apr 17 '13 at 09:06
  • So for small $m$ and large $n$, you get $S = n + m - \sum [\ldots] \to n + m - (1.04\ldots)n < 0$? – TMM Apr 17 '13 at 09:34
  • @TMM The problem is Stirling's approximation which is too crude I think. The constant should be below $1$. –  Apr 17 '13 at 09:59
  • 1
    @motl737: my answer shows that small $k$ play a major role in the sum. Since Stirling is an asymptotic approximation, the approximation for small $k$ may not be good enough. I am reworking my answer and coming across some interesting identities. – robjohn Apr 17 '13 at 13:29
  • @robjohn: That is why I was trying to consider the $\lambda_n$ term in the approximation (see my comments on the question), and I believe that is valid for all $n$. Perhaps you could work that in? – Aryabhata Apr 17 '13 at 14:55
  • @Aryabhata: I just noticed your comment. I may have saved some time if I had noticed it earlier, but I have just finished computing $$ W(x)=\sum_{k=1}^\infty\frac{(-k)^{k-1}}{k!}x^k $$ I am almost finished with my updated answer. – robjohn Apr 17 '13 at 16:36
  • @Aryabhata: it took a bit longer to finish. Done now, and it is close to what motl737 thought it would be $\sqrt{2mn}$. – robjohn Apr 17 '13 at 23:32
  • For $n=100,m=1$ my approximation is within $0.2$ of the actual answer. – robjohn Apr 17 '13 at 23:38
  • @robjohn: Thanks! It will take quite some time to go through the whole thing :-) – Aryabhata Apr 17 '13 at 23:54
  • @robjohn That's really impressive! Thank you. One thing I didn't understand quite understand. If $m = n/100$ say then $a =1/100$. Does your approximation still hold in this case? –  Apr 18 '13 at 06:20
  • @motl737: it worked or $n=100,m=1$. Did you have some particular values you were concerned about? – robjohn Apr 18 '13 at 10:13
  • @robjohn I hope this isn't too fussy but does your result give the correct asymptotics for the case $m=1$. You get $\lim_{n \rightarrow \infty} S/\sqrt{n} = \frac{7}{4\sqrt{2}}$ I think even including your error term. Unless I made a silly mistake. It should be $ S/\sqrt{n} \sim \sqrt{\frac{\pi}{2}}$. –  Apr 18 '13 at 12:47
  • @robjohn I have checked and $S \sim \sqrt{\frac{\pi n}{2}}$ when $m=1$ (assuming you believe oeis). See my question at http://mathoverflow.net/questions/128014/elementary-proof-for-identity-involving-sums-of-binomials . –  Apr 18 '13 at 21:29
  • @robjohn I think the problem is in the claim $n\sum_{k=1}^n\left(1+\frac{k-\alpha k^2}{2n}+O\left(\frac1{n^2}\right)\right) \frac{k^{k-1}}{k!,e^{k(1+\alpha)}} =-n\mathrm{W}\left(-e^{-1-\alpha}\right) +\frac12\sum_{k=1}^n\Big((1-\alpha)k-\alpha k(k-1)\Big) \frac{k^{k-1}}{k!,e^{k(1+\alpha)}} +O\left(\frac1n\right)$. –  Apr 19 '13 at 08:34
  • @motl737: I am aware that $\left(1-\frac{k}{n}\right)^{m-1/2}$ needs a different approach for small $m$, and I am working on that. However, $\alpha$ is constant when $m$ grows with $n$ (which was one of mentioned at one point). – robjohn Apr 19 '13 at 09:02
  • @robjohn Thanks! If $m/n$ is a constant that is an interesting case you are right. $m$ could grow like $n^c$ as well where $0< c< 1$. –  Apr 19 '13 at 09:36
  • @motl737: I think the current answer is good. – robjohn Apr 19 '13 at 17:57
  • Thanks again! Your new result holds for constant $m$ right? It isn't true for $m=n$ for example. –  Apr 19 '13 at 18:36
  • Since the error term is $O(m)$, the result holds for $m=n$, but is meaningless. To be meaningful, we would want $m/n\to0$ as $n\to\infty$. – robjohn Apr 19 '13 at 18:55
  • Yes of course, thanks! I suppose your previous method works when $m/n$ is a constant in any case. –  Apr 19 '13 at 20:13
  • @motl737: I just verified for my comment to GEdgar that your guess matches my answer. That is, $$ \sqrt{2n}\frac{\Gamma\left(m+\frac12\right)}{(m-1)!}=\sqrt{2\pi n}\frac{m}{4^m}\binom{2m}{m} $$ – robjohn Apr 19 '13 at 20:26
  • That's really great. Thank you again. So something amazing happens between $m=n^{1-\epsilon}$ and $m=n$ where the asymptotic prefactor jumps from $\sqrt{2}$ to roughly $1.841$. I wonder how that happens. –  Apr 19 '13 at 21:03
  • "I suppose your previous method works when $m/n$ is a constant". I wouldn't trust my previous answers. I believe that this answer fixes problems in my previous attempts. – robjohn Apr 19 '13 at 21:10
  • @motl737: "So something amazing happens between $m=n^{1-\epsilon}$ and $m=n$ where the asymptotic prefactor jumps from $\sqrt2$ to roughly $1.841$." It might be useful to note that as $n\to\infty$, $n^{1-\epsilon}/n\to0$. That is, most of $n$ is above $n^{1-\epsilon}$ – robjohn Apr 19 '13 at 21:13
  • @motl737: Check out the Further Considerations above. – robjohn Apr 19 '13 at 21:56
2

Computation for constant $m$ positive integer. This uses the same method as in Estimate $\sum_{k=1}^{n} k^{k-1} \binom{n}{k} (n-k)^{n+1-k}$ , further explanation is there.

Write \begin{equation*} u_{-1}(z) = \sum_{n=1}^\infty \frac{n^{n-1}}{n!} z^n \tag{1}\end{equation*} Then the unique singularity nearest to the origin is at $z=e^{-1}$, and we have an expansion there: \begin{equation*} u_{-1}(z) = 1 - \sqrt{2}(1-ez)^{1/2}+\frac{2}{3}(1-ez) +O\left((1-ez)^{3/2}\right) \tag{2}\end{equation*} as $z \to e^{-1}$ from the left. Define recursively $u_m(z) = z u_{m-1}'(z)$ for $m = 0,1,2,\dots$. Then we have \begin{equation*} u_m(z) = \sum_{n=0}^\infty \frac{n^{n+m}}{n!}z^n \tag{3}\end{equation*} by induction. To expand these at $e^{-1}$ we will also need the expansion of $z$: \begin{equation*} z = e^{-1} - e^{-1}(1-ez) = e^{-1} +O\left((1-ez)^1\right) \tag{4}\end{equation*} Now differentiate (2) and multiply by (4) to get \begin{align*} u_0(z) = \frac{1}{\sqrt{2}}(1-ez)^{-1/2}-\frac{2}{3} +O\left((1-ez)^{1/2}\right) \tag{5}\end{align*} Differentiate this and multiply by (4) to get \begin{align*} u_1(z) &= \frac{1}{2\sqrt{2}} (1-ez)^{-3/2} +O\left((1-ez)^{-1/2}\right) \\ &= \frac{\Gamma(3/2)}{\sqrt{2\pi}} (1-ez)^{-3/2} +O\left((1-ez)^{-1/2}\right) \end{align*} Continuing, by induction we get \begin{equation*} u_m(z) = \frac{\Gamma(m+1/2)}{\sqrt{2\pi}}(1-ez)^{-m-1/2} +O\left((1-ez)^{-m+1/2}\right) \tag{6}\end{equation*} for $m \ge 1$.

Now fix positive integer $m$. (The extra term $-2/3$ in (5) mean that the formula for $m=0$ is different, but can also be done by this method.) Multiply (1) and (3) to get \begin{equation*} h(z) := u_{-1}(z)u_m(z) = \sum_{n=1}^\infty\left(\frac{1}{n!} \sum_{k=1}^n \binom{n}{k}\frac{k^{k-1}}{k!}\, \frac{(n-k)^{n-k+m}}{(n-k)!}\right)z^n =:\sum_{n=1}^\infty c_n z^n \end{equation*} Multiply (2) and (6) to get $$ h(z) = \frac{\Gamma(m+1/2)}{\sqrt{2\pi}}(1-ez)^{-m-1/2} -\frac{\Gamma(m+1/2)}{\sqrt{\pi}}(1-ez)^{-m} +O\left((1-ez)^{-m+1/2}\right) $$ as $z \to e^{-1}$ from the left. So by the Szegö method, we get an asymptotic series \begin{align*} c_n &\approx e^n\left[ \frac{\Gamma(m+1/2)}{\sqrt{2\pi}}\binom{n+m-1/2}{n} -\frac{\Gamma(m+1/2)}{\sqrt{\pi}}\binom{n+m-1}{n}+\dots \right] \\ c_n &= e^n\Bigg[ \frac{\Gamma(m+1/2)}{\sqrt{2\pi}}\left( \frac{1}{\Gamma(m+1/2)}n^{m-1/2}+O(n^{m-3/2})\right) \\ &\qquad\qquad -\frac{\Gamma(m+1/2)}{\sqrt{\pi}}\left( \frac{1}{(m-1)!}n^{m-1} +O\left(n^{m-2}\right) \right) +O\left(n^{m-3/2}\right) \Bigg] \\ &= e^n\left[\frac{1}{\sqrt{2\pi}}n^{m-1/2} -\frac{\Gamma(m+1/2)}{(m-1)!\sqrt{\pi}}n^{m-1}+O\left(n^{m-3/2}\right)\right] \end{align*} as $n \to \infty$.

Multiply by Stirling's formula, $$ n! = e^{-n}n^n\sqrt{2\pi}\left( n^{1/2}+O\left(n^{-1/2}\right)\right) $$ to get \begin{align*} &\sum_{k=1}^n\binom{n}{k} \frac{k^{k-1} (n-k)^{n-k+m}}{n^{n+m-1}} = c_n\frac{n!}{n^{n+m-1}} % \\ &\qquad = n - \frac{\sqrt{2}\,\Gamma(m+1/2)}{(m-1)!}\,n^{1/2} + O\left(1\right) \end{align*} so \begin{align*} S &= n+m-\sum_{k=1}^n\binom{n}{k} \frac{k^{k-1} (n-k)^{n-k+m}}{n^{n+m-1}} \\ &= n+O\left(1\right) -n + \frac{\sqrt{2}\,\Gamma(m+1/2)}{(m-1)!}\,n^{1/2} + O\left(1\right) \\ &= \frac{\sqrt{2}\,\Gamma(m+1/2)}{(m-1)!}\,n^{1/2} + O\left(1\right) \end{align*} as $n \to \infty$, since $m$ is constant.

GEdgar
  • 111,679
  • Thanks! Does this completely fail when $m$ grows with $n$ or does it depend on how it grows with $n$? For example, what if we assume that $m/n$ tends to $0$ as $n$ tends to $\infty$? –  Apr 19 '13 at 19:38
  • As far as I can see, this does not work at all for $n=m$ as in one of your other questions. Nor in any case when $m$ increases with $n$. – GEdgar Apr 19 '13 at 19:59
  • @GEdgar: I just verified that our answers agree. That is, $$ \frac{\sqrt2,\Gamma(m+1/2)}{(m-1)!}n^{1/2}=\sqrt{2\pi n}\frac{m}{4^m}\binom{2m}{m} $$ – robjohn Apr 19 '13 at 20:20
  • @robjohn Does this mean that GEdgar's answer (and my guess) is in fact right asymptotically even for $m=n^{1-\epsilon}$ even though GEdgar's proof technique doesn't prove it? –  Apr 20 '13 at 07:29
  • @motl737: it would seem so, since the expressions are equal. – robjohn Apr 20 '13 at 08:59