techmologist
- 305
- 12
ere me now.
I'm trying to figure out how many words of length r having exactly k distinct letters can be made with an alphabet of size n. Call this number a_k,r. It satisfies the recursion
a_{k,r} = ka_{k,r-1} + (n-k+1)a_{k-1,r-1}
a_{1,r} = n for r >= 1
a_{k,r} = 0 for r < k
My best effort so far is to use a generating function as follows
f_k(x) = \sum_{r=1}^{\infty}a_{k,r}x^r
and use the recursion formula to get
f_k(x) = \frac{(n-k+1)x}{1-kx}f_{k-1}(x) = \frac{x^{k-1}(n-1)(n-2)...(n-k+1)}<br /> {(1-x)(1-2x)...(1-kx)}f_1(x)
or since f_1(x) = n/(1-x),
f_k(x) = \frac{(k-1)!\left(^n_{k-1} \right)x^{k-1}}{(1-x)(1-2x)...(1-kx)}
I'm having a well difficult time getting the coefficient of x^r (which would be a_k,r) in the expansion of this. Is there a way to simplify it so you don't have k nested sums? thanks.
I'm trying to figure out how many words of length r having exactly k distinct letters can be made with an alphabet of size n. Call this number a_k,r. It satisfies the recursion
a_{k,r} = ka_{k,r-1} + (n-k+1)a_{k-1,r-1}
a_{1,r} = n for r >= 1
a_{k,r} = 0 for r < k
My best effort so far is to use a generating function as follows
f_k(x) = \sum_{r=1}^{\infty}a_{k,r}x^r
and use the recursion formula to get
f_k(x) = \frac{(n-k+1)x}{1-kx}f_{k-1}(x) = \frac{x^{k-1}(n-1)(n-2)...(n-k+1)}<br /> {(1-x)(1-2x)...(1-kx)}f_1(x)
or since f_1(x) = n/(1-x),
f_k(x) = \frac{(k-1)!\left(^n_{k-1} \right)x^{k-1}}{(1-x)(1-2x)...(1-kx)}
I'm having a well difficult time getting the coefficient of x^r (which would be a_k,r) in the expansion of this. Is there a way to simplify it so you don't have k nested sums? thanks.