9

We present a problem inspired by the work at this MSE link. In particular, we consider a coupon collector scenario with $n$ coupons where an integer $1\le j\le n-1$ is given. We introduce two random variables, namely $T$ and $Q$ where $T$ represents the number of draws until all coupons have been collected and $Q$ the number of different coupons that appeared in the first $j$ draws. The following conjecture is submitted for your consideration.

$$\mathrm{E}\left[{T\choose Q}\right] = \sum_{k=1}^j \frac{n!}{n^{n-k-1+j}} \times {j\brace k} \sum_{r=0}^k {n+j-k\choose k-r} \\ \times \sum_{p=0}^{n-k-1} \frac{(-1)^{n-k-1-p}}{p! (n-k-1-p)!} \frac{(k+p)^{n-k-1+r}}{(n-k-p)^{r+1}}.$$

I have what I believe to be a proof but it is quite involved. We propose the following list of questions concerning the above identity:

  • does it indeed hold and does it perhaps have a straightforward proof using probabilistic methods and is there structural simplification

  • what are the asymptotics, are there effective estimates of these terms that match the numeric exact values from the formula without having recurse to a triple sum.

The reader is invited to compare potentially relevant asymptotics to the data from the identity.

There is the following extremely basic (no pun intended) C program which I include here to help clarify what interpretation of the problem is being used. Compiled with GCC 4.3.2 and the std=gnu99 option.

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include <string.h>

long choose(long n, long k)
{
  long num = 1, denom = 1;

  while(k > 0){
    num *= n;
    denom *= k;

    n--; k--;
  }

  return num/denom;
}


int main(int argc, char **argv)
{
  int n = 6 , j = 3, trials = 1000; 

  if(argc >= 2){
    n = atoi(argv[1]);
  }

  if(argc >= 3){
    j = atoi(argv[2]);
  }

  if(argc >= 4){
    trials = atoi(argv[3]);
  }

  assert(1 <= n);
  assert(1 <= j && j < n);
  assert(1 <= trials);

  srand48(time(NULL));
  long long data = 0;

  long genstats[n];
  memset(genstats, 0, n*sizeof(long));

  for(int tind = 0; tind < trials; tind++){
    int seen = 0; int steps = 0; 
    int dist[n], startseg[n];

    for(int cind = 0; cind < n; cind++){
      dist[cind] = 0; startseg[cind] = 0;
    }

    while(seen < n){
      int coupon = drand48() * (double)n;
      genstats[coupon]++;

      steps++;

      if(steps <= j)
        startseg[coupon]++;

      if(dist[coupon] == 0)
        seen++;
      dist[coupon]++;
    }

    int stseen = 0;
    for(int stcoup = 0; stcoup < n; stcoup++)
      if(startseg[stcoup] > 0)
        stseen++;

    data += choose(steps, stseen);
  }

  long double expt = (long double)data/(long double)trials;
  printf("[n = %d, j = %d, trials = %d]: %Le\n", 
         n, j, trials, expt);


  long long gentotal = 0;
  for(int cind = 0; cind < n; cind++){
    gentotal += genstats[cind];
  }

  for(int cind = 0; cind < n; cind++){
    printf("%02d: %.8Le\n", cind,
           (long double)genstats[cind]
           /(long double)gentotal);
  }
  exit(0);
}

Addendum. As a sanity check when $j=1$ the formula should produce $n H_n$ for $n\ge 2.$ In fact we obtain

$$\frac{n!}{n^{n-1}} \left(n\times \sum_{p=0}^{n-2} \frac{(-1)^{n-2-p}}{p! (n-2-p)!} \frac{(1+p)^{n-2}}{n-1-p} + \sum_{p=0}^{n-2} \frac{(-1)^{n-2-p}}{p! (n-2-p)!} \frac{(1+p)^{n-1}}{(n-1-p)^2}\right).$$

For the first sum we introduce

$$f(z) = \frac{(1+z)^{n-2}}{n-1-z} \prod_{q=0}^{n-2} \frac{1}{z-q}$$

so that the sum is given by (residues sum to zero)

$$\sum_{q=0}^{n-2} \mathrm{Res}_{z=q} f(z) = -\mathrm{Res}_{z=n-1} f(z) - \mathrm{Res}_{z=\infty} f(z).$$

The contribution from the first term is $$\frac{n^{n-2}}{(n-1)!}$$ and from the second

$$\mathrm{Res}_{z=0} \frac{1}{z^2} \frac{(1+1/z)^{n-2}}{n-1-1/z} \prod_{q=0}^{n-2} \frac{1}{1/z-q} = \mathrm{Res}_{z=0} \frac{1}{z^n} \frac{(1+z)^{n-2}}{n-1-1/z} \prod_{q=0}^{n-2} \frac{z}{1-qz} \\ = \mathrm{Res}_{z=0} \frac{1}{z} \frac{(1+z)^{n-2}}{n-1-1/z} \prod_{q=0}^{n-2} \frac{1}{1-qz} = \mathrm{Res}_{z=0} \frac{(1+z)^{n-2}}{z(n-1)-1} \prod_{q=0}^{n-2} \frac{1}{1-qz} = 0.$$

Hence the first sum contributes

$$\frac{n!}{n^{n-1}} \times n \frac{n^{n-2}}{(n-1)!} = n.$$

For the second sum we use

$$g(z) = \frac{(1+z)^{n-1}}{(n-1-z)^2} \prod_{q=0}^{n-2} \frac{1}{z-q} = \frac{(1+z)^{n-1}}{(z-(n-1))^2} \prod_{q=0}^{n-2} \frac{1}{z-q}.$$

We get for the negative of the residue at $n-1$ the value

$$-\left((1+z)^{n-1} \prod_{q=0}^{n-2} \frac{1}{z-q} \right)' _{z=n-1} \\ = -\left((n-1)(1+z)^{n-2} \prod_{q=0}^{n-2} \frac{1}{z-q} - (1+z)^{n-1} \prod_{q=0}^{n-2} \frac{1}{z-q} \sum_{q=0}^{n-2} \frac{1}{z-q}\right)_{z=n-1} \\ = - \left((n-1)n^{n-2} \frac{1}{(n-1)!} - n^{n-1} \frac{1}{(n-1)!} H_{n-1}\right).$$

Multiply by $n!/n^{n-1}$ to get

$$n H_{n-1} - (n-1)n^{n-2} \frac{1}{(n-1)!} \frac{n!}{n^{n-1}} \\ = n H_{n-1} - (n-1)\frac{n}{n} = n H_{n-1} - (n-1).$$

For the negative of the residue at infinity we obtain

$$\mathrm{Res}_{z=0} \frac{1}{z^2} \frac{(1+1/z)^{n-1}}{(n-1-1/z)^2} \prod_{q=0}^{n-2} \frac{1}{1/z-q} = \mathrm{Res}_{z=0} \frac{1}{z^{n+1}} \frac{(1+z)^{n-1}}{(n-1-1/z)^2} \prod_{q=0}^{n-2} \frac{z}{1-qz} \\ = \mathrm{Res}_{z=0} \frac{1}{z^2} \frac{(1+z)^{n-1}}{(n-1-1/z)^2} \prod_{q=0}^{n-2} \frac{1}{1-qz} \\ = \mathrm{Res}_{z=0} \frac{(1+z)^{n-1}}{(z(n-1)-1)^2} \prod_{q=0}^{n-2} \frac{1}{1-qz} = 0.$$

Collecting everything we get

$$n H_{n-1} - (n-1) + n = n H_{n-1} + n \frac{1}{n}$$

or alternatively

$$\bbox[5px,border:2px solid #00A000]{n H_n}$$

and the sanity check goes through. Observe that we evidently require something more sophisticated to prove the conjectured identity e.g. when $j=n-1.$ (Remark. We don't need to actually apply the formula for the residues at infinity, it is sufficient when working with rational functions to observe that both $f(z)$ and $g(z)$ have the difference between the degree of the denominator and of the numerator equal to two.)

Marko Riedel
  • 61,317

2 Answers2

3

A formula for the expectation

Applying the total probability formula, the expected value is $$ \begin{align} \sum_{q\leq j} P(Q=q) E\left[ \binom Tq \bigg\vert Q=q \right]. \end{align} $$ To find this, we apply the binomial formula $(1+z)^T = \sum_{k=0}^T \binom Tk z^k$ and find the expected value: $$ \begin{align} \sum_{q\leq j} P(Q=q) E\left[ (1+z)^T \bigg\vert Q=q\right]&= \sum_{q\leq j} P(Q=q) (1+z)^jE\left[ (1+z)^{T-j} \bigg\vert Q=q\right]. \end{align} $$ Now $$ E\left[ (1+z)^{T-j} \bigg\vert Q=q\right]=\prod_{q<k\leq n} \frac{ (1+z) \frac{n-k+1}n}{1-(1+z) \frac{k-1}n}. $$ On the other hand, $$ P(Q=q)=\left\{ j \atop q\right\}\frac{(n)_q}{n^j} $$ where $(n)_q = n(n-1)\cdots (n-q+1)$ is the falling factorial.

To find the desired expectation, we need to calculate the coefficient of $z^q$ in $$ \begin{align} (1+z)^j \prod_{q<k\leq n} \frac{ (1+z) \frac{n-k+1}n}{1-(1+z) \frac{k-1}n}&= (1+z)^{n-q+j} \prod_{q<k\leq n} \frac{\frac{n-k+1}n}{1-\frac{k-1}n-z\frac{k-1}n}\\ &=(1+z)^{n-q+j} \prod_{q<k\leq n}\frac{1}{1-z\frac{k-1}{n-k+1}}. \end{align} $$ Thus, my formula for the expectation is $$ E\left[\binom T Q\right]=\sum_{q\leq j}\left\{ j \atop q\right\}\frac{(n)_q}{n^j}\sum_{r+s=q} \binom{n-q+j}r \sum_{\sum_{q<k\leq n} a_k = s} \prod_{q<k\leq n}\left(\frac{k-1}{n-k+1}\right)^{a_k}. \ \ \ (1) $$ A quick check with $j=1$ reduces to the coefficient of $z$ in $$ (1+z)^n \prod_{1<k\leq n}\frac1{1-z\frac{k-1}{n-k+1}}$$ and it is $$ n+\sum_{1<k\leq n} \frac{k-1}{n-k+1}=n+\sum_{2\leq k\leq n} \left(-1+\frac n{n-k+1}\right)=nH_n. $$ An asymptotic formula for fixed $j$

We prove that for a constant $j$, we have as $n\rightarrow\infty$, $$ E\left[\binom T Q\right]\sim \frac{(n\log n)^j}{j!}. $$ For each $q<k\leq n$, $$ 0\leq \frac{k-1}{n-k+1} = -1 + \frac n{n-k+1} < \frac n{n-k+1}. $$ Let $0<\epsilon<1$. By $(1)$, we have for sufficiently large $n$, $$A_n \leq E\left[\binom T Q\right]\leq B_n$$ where $$ A_n=\sum_{q\leq j}\left\{ j \atop q\right\}\frac{(n)_q}{n^j}\sum_{r+s=q} \binom{n-q+j}r \sum_{\sum_{n-n^{\epsilon}< k\leq n} a_k = s} \prod_{n-n^{\epsilon}<k\leq n}\left(\frac{k-1}{n-k+1}\right)^{a_k}, $$ $$ B_n=\sum_{q\leq j}\left\{ j \atop q\right\}\frac{(n)_q}{n^j}\sum_{r+s=q} \binom{n-q+j}r \sum_{\sum_{q<k\leq n} a_k = s} \prod_{q<k\leq n}\left(\frac{n}{n-k+1}\right)^{a_k}. $$ We focus on the inner sum of $B_n$ $$ \sum_{\sum_{q<k\leq n} a_k = s} \prod_{q<k\leq n}\left(\frac{n}{n-k+1}\right)^{a_k}=n^s\sum_{\sum_{q<k\leq n} a_k = s} \prod_{q<k\leq n}\left(\frac{1}{n-k+1}\right)^{a_k} .$$ By induction, this is $$\sim n^s \frac{(\log n)^s}{s!}$$ Similarly, the inner sum of $A_n$ is $$\sum_{\sum_{n-n^{\epsilon}< k\leq n} a_k = s} \prod_{n-n^{\epsilon}<k\leq n}\left(\frac{k-1}{n-k+1}\right)^{a_k}\geq \left(1-\frac{n^{\epsilon}}n\right)n^s\sum_{\sum_{n-n^{\epsilon}< k\leq n} a_k = s} \prod_{n-n^{\epsilon}<k\leq n}\left(\frac{1}{n-k+1}\right)^{a_k}$$ Now, the right side is asyptotic to $$ \sim \left(1-\frac1{n^{1-\epsilon}}\right)n^s \frac{(\epsilon\log n)^s}{s!} $$ Let $\delta>0$. For sufficiently large $n$, we have $$\sum_{q\leq j}\left\{ j \atop q\right\}\frac{(n)_q}{n^j}\sum_{r+s=q} \binom{n-q+j}r (1-\delta)^s \frac{(n \epsilon \log n)^s}{s!}\leq A_n, $$ Thus, by binomial theorem, $$ (1-\delta)^j \sum_{q\leq j}\left\{ j \atop q\right\} \frac{n^q}{n^j} \frac1{q!} \left( n + n\epsilon \log n\right)^q \leq A_n $$ The sum over $q\leq j$ is dominated by the term at $q=j$. Therefore, by similar calculation for $B_n$, we have $$ (1-\delta)^j \frac{(n+n\epsilon \log n)^j}{j!} \leq A_n \leq B_n \sim \frac{(n\log n)^j}{j!}. $$ Hence, letting $\delta\rightarrow 0$, $\epsilon \rightarrow 1$, we have the asymptotic $$ E\left[\binom TQ\right] \sim \frac{(n\log n)^j}{j!}. $$

Sungjin Kim
  • 20,102
  • 1
    This is very good work. Verified by close study and also by checking the formula numerically. (+1). With all due respect I point out that it would be nice to have the second part of the question, that being the conversion to the triple sum. – Marko Riedel Feb 04 '17 at 23:30
  • Thank you. But currently I am not sure if the formula you gave and mine are equivalent. I will think about the second part though. – Sungjin Kim Feb 05 '17 at 00:17
  • @MarkoRiedel I conjecture that the asymptotic for fixed $j$ and $n\rightarrow\infty$ is $\sim (n\log n)^j / j!$. Is this also conjectured by your numerical data? – Sungjin Kim Feb 10 '17 at 05:46
  • I will most likely award you the bounty since nobody else posted any progress toward a (simple) solution. Consult my post for more information on what I was able to find. – Marko Riedel Feb 10 '17 at 23:37
  • I just uploaded the asymptotic, and the proof. – Sungjin Kim Feb 10 '17 at 23:38
  • Numeric experiments indicate that this asymptotic may well work for $j$ constant relative to $n.$ No useable data appeared for other orders of growth of $j$ in $n$ as it was not possible to go high enough to observe the asymptotics. – Marko Riedel Feb 11 '17 at 00:06
1

We use the notation from the following MSE link with $m$ for the number of rolls and $n$ for the number of coupons. We can actually answer a more general question, namely what is the expected number of different faces in the first $j$ rolls where $j\le n-1.$ We classify according to the number $k$ of different faces that appeared where $1\le k\le j$. There are at least two types of coupons.

First let us verify that we indeed have a probability distribution here. We have for the number $T$ of coupons being $m$ draws that the number of configurations i.e. admissible sequences of draws is

$${n\choose k} \times {j\brace k} \times k! \times (n-k) \\ \times \sum_{p=0}^k {k\choose p} {m-1-j\brace p+n-k-1} \times (p+n-k-1)!.$$

Observe that

$$\sum_{p=0}^k {k\choose p} {m-1-j\brace p+n-k-1} \times (p+n-k-1)! \\ = (m-1-j)! [z^{m-1-j}] \sum_{p=0}^k {k\choose p} (\exp(z)-1)^{p+n-k-1} \\ = (m-1-j)! [z^{m-1-j}] (\exp(z)-1)^{n-k-1} \sum_{p=0}^k {k\choose p} (\exp(z)-1)^{p} \\ = (m-1-j)! [z^{m-1-j}] (\exp(z)-1)^{n-k-1} \exp(kz).$$

This is

$$(n-k-1)! \sum_{p=0}^{m-1-j} {m-1-j\choose p} {p\brace n-k-1} \times k^{m-1-j-p}.$$

We thus introduce the generating function

$$G_{j,k}(z) = \sum_{m\ge n} z^m \sum_{p=0}^{m-1-j} {m-1-j\choose p} {p\brace n-k-1} \times k^{m-1-j-p}.$$

Now put

$${m-1-j\choose p} = \frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{1}{w^{m-j-p}} \frac{1}{(1-w)^{p+1}} \; dw$$

which controls the range so we may extend $p$ to infinity which yields

$$G_{j,k}(z) = k^{-1-j} \sum_{m\ge n} z^m k^m \\ \times \frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{1}{w^{m-j}} \frac{1}{1-w} \sum_{p\ge 0} {p\brace n-k-1} \frac{w^p}{(1-w)^p} \times k^{-p} \; dw.$$

Recall the OGF of the Stirling numbers of the second kind which says that

$${n\brace k} = [z^n] \prod_{q=1}^k \frac{z}{1-qz}.$$

In the present case this yields

$$G_{j,k}(z) = k^{-1-j} \sum_{m\ge n} z^m k^m \\ \times \frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{1}{w^{m-j}} \frac{1}{1-w} \prod_{q=1}^{n-k-1} \frac{w/(1-w)/k}{1-qw/(1-w)/k} \; dw \\ = k^{-1-j} \sum_{m\ge n} z^m k^m \\ \times \frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{1}{w^{m+1}} \frac{w^{j+1}}{1-w} \prod_{q=1}^{n-k-1} \frac{w/(1-w)/k}{1-qw/(1-w)/k} \; dw \\ = k^{-1-j} \frac{k^{j+1} z^{j+1}}{1-kz} \prod_{q=1}^{n-k-1} \frac{z/(1-kz)}{1-qz/(1-kz)} \\ = \frac{z^{j+1}}{1-kz} \prod_{q=1}^{n-k-1} \frac{z}{1-kz-qz} = \frac{z^{n+j-k}}{1-kz} \prod_{q=1}^{n-k-1} \frac{1}{1-kz-qz} \\ = z^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-kz-qz}.$$

We have shown that for the probability of having $m$ draws we get

$$\bbox[5px,border:2px solid #00A000]{ P[T=m] = \frac{n!}{n^m} \sum_{k=1}^j {j\brace k} [z^m] z^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-kz-qz}.}$$

This gives for the sum of the probabilities

$$n! \sum_{k=1}^j {j\brace k} \frac{1}{n^{n+j-k}} \prod_{q=0}^{n-k-1} \frac{1}{1-k/n-q/n} \\ = n! \sum_{k=1}^j {j\brace k} \frac{1}{n^{n+j-k}} \prod_{q=0}^{n-k-1} \frac{n}{n-k-q} = n! \sum_{k=1}^j {j\brace k} \frac{1}{n^{j}} \prod_{q=0}^{n-k-1} \frac{1}{n-k-q} \\ = \frac{n!}{n^j} \sum_{k=1}^j {j\brace k} \frac{1}{(n-k)!} = \frac{1}{n^j} \sum_{k=1}^j {n\choose k} k! {j\brace k} = \frac{1}{n^j} j! [z^j] \sum_{k=1}^j {n\choose k} (\exp(z)-1)^k.$$

Now since $\exp(z)-1$ starts at $z$ the power $k$ starts at $z^k.$ Therefore we may extend the range of $k$ beyond $j$ without adding any terms (coefficient on $[z^j]$ being extracted). We may also include $k=0,$ which is a number. We obtain

$$\frac{1}{n^j} j! [z^j] \sum_{k=0}^n {n\choose k} (\exp(z)-1)^k = \frac{1}{n^j} j! [z^j] \exp(nz) = \frac{1}{n^j} j! \frac{n^j}{j!} = 1.$$

This confirms it being a probability distribution.

Moving on to the expectation we evidently require the following quantity:

$$\sum_{m\ge n} {m\choose k} \times \frac{n!}{n^m} \times {j\brace k} [z^m] z^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-kz-qz} \\ = \frac{n!}{n^k} \times {j\brace k} \times \sum_{m\ge n} {m\choose k} \frac{1}{n^{m-k}} [z^m] z^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-kz-qz} \\ = \frac{n!}{k! \times n^k} \times {j\brace k} \times \sum_{m\ge n} \frac{1}{n^{m-k}} m^{\underline{k}} [z^m] z^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-kz-qz} \\ = \frac{n!}{k! \times n^k} \times {j\brace k} \times \left.\left(z^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-kz-qz} \right)^{(k)}\right|_{z=1/n.}$$

We move to deploy the generalized Leibniz rule which requires

$$\sum_{p\ge 0} \frac{1}{p!} (z^{n+j-k})^{(p)} w^p = \sum_{p\ge 0} {n+j-k\choose p} z^{n+j-k-p} w^p \\ = z^{n+j-k} \left(1+\frac{w}{z}\right)^{n+j-k} = (w+z)^{n+j-k}$$

as well as

$$\sum_{p\ge 0} \frac{1}{p!} \left(\frac{1}{1-kz-qz}\right)^{(p)} w^p = \sum_{p\ge 0} \frac{(k+q)^p}{(1-kz-qz)^{p+1}} w^p \\ = \frac{1}{1-kz-qz} \frac{1}{1-(k+q)w/(1-kz-qz)} = \frac{1}{1-(k+q)(w+z)}.$$

Hence the substituted derivative is

$$k! [w^k] (w+1/n)^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-(k+q)(w+1/n)}$$

which yields for the sum

$$\frac{n!}{n^k} \times {j\brace k} \times [w^k] (w+1/n)^{n+j-k} \prod_{q=0}^{n-k-1} \frac{1}{1-(k+q)(w+1/n)}.$$

Prepare for partial fractions by residues on the product term which yields

$$\prod_{q=0}^{n-k-1} \frac{1}{k+q} \prod_{q=0}^{n-k-1} \frac{1}{1/(k+q)-(w+1/n)} \\ = \frac{(k-1)!}{(n-1)!} (-1)^{n-k} \prod_{q=0}^{n-k-1} \frac{1}{w-(1/(k+q)-1/n)}.$$

We get for the residue at $w=1/(k+p)-1/n$

$$\prod_{q=0, q\ne p}^{n-k-1} \frac{1}{1/(k+p)-1/n-(1/(k+q)-1/n)} \\ = \prod_{q=0, q\ne p}^{n-k-1} \frac{1}{1/(k+p)-1/(k+q)} = \prod_{q=0, q\ne p}^{n-k-1} \frac{(k+p)(k+q)}{q-p} \\ = \frac{(n-1)!}{(k-1)!} (-1)^p \frac{1}{p!} \frac{(k+p)^{n-k-2}}{(n-k-1-p)!}.$$

We thus obtain

$$\frac{n!}{n^k} \times {j\brace k} \times [w^k] (w+1/n)^{n+j-k} \\ \times \sum_{p=0}^{n-k-1} \frac{1}{w-(1/(k+p)-1/n)} (-1)^{n-k+p} \frac{1}{p!} \frac{(k+p)^{n-k-2}}{(n-k-1-p)!}.$$

Observe that

$$[w^r] \frac{1}{w-(1/(k+p)-1/n)} \\ = - \frac{1}{1/(k+p)-1/n} [w^r] \frac{1}{1-w/(1/(k+p)-1/n)} \\ = - \frac{1}{(1/(k+p)-1/n)^{r+1}}$$

and we obtain the sum form

$$-\frac{n!}{n^k} \times {j\brace k} \sum_{r=0}^k [w^{k-r}] (w+1/n)^{n+j-k} \\ \times \sum_{p=0}^{n-k-1} \frac{(-1)^{n-k-p}}{p! (n-k-1-p)!} (k+p)^{n-k-2} \frac{1}{(1/(k+p)-1/n)^{r+1}} \\ = -\frac{n!}{n^k} \times {j\brace k} \sum_{r=0}^k {n+j-k\choose k-r} \frac{1}{n^{n+j-2k+r}} \\ \times \sum_{p=0}^{n-k-1} \frac{(-1)^{n-k-p}}{p! (n-k-1-p)!} \frac{n^{r+1} (k+p)^{n-k-1+r}}{(n-k-p)^{r+1}} \\ = \frac{n!}{n^{n-k-1+j}} \times {j\brace k} \sum_{r=0}^k {n+j-k\choose k-r} \\ \times \sum_{p=0}^{n-k-1} \frac{(-1)^{n-k-1-p}}{p! (n-k-1-p)!} \frac{(k+p)^{n-k-1+r}}{(n-k-p)^{r+1}}.$$

Marko Riedel
  • 61,317