[Math] Finding the coefficient of a generating function

binomial-coefficientscombinatoricsdicegenerating-functions

Given $f(x) = x^4\left(\frac{1-x^6}{1-x}\right)^4 = (x+x^2+x^3+x^4+x^5+x^6)^4$. This is the generating function $f(x)$ of $a_n$, which is the number of ways to get $n$ as the sum of the upper faces of four thrown dice.

How do I calculate a coefficient from said generating function, for example $a_{17}$?

I could of course write it all out, but that would take a lot of time. Is there a quicker way to do it?


I've rewritten the formula as $x^4(1-x^6)^4\left(\frac1{1-x}\right)^4$, giving me to find the coefficient of $x^{17-4}=x^{13}$ of $(1-x^6)^4\left(\frac1{1-x}\right)^4$. I'm, however, stuck there.

Best Answer

You want: \begin{align} [z^{17}] z^4 (1 - z^6)^4 (1 - z)^{-4} &= [z^{13}] (1 - 4 z^6 + 6 z^{12} - 4 z^{18} + z^{24}) \cdot \sum_{k \ge 0} \binom{-4}{k} (-1)^k z^k \\ &= [z^{13}] (1 - 4 z^6 + 6 z^{12}) \cdot \sum_{k \ge 0} \binom{k + 3}{3} z^k \\ &= \binom{16}{3} - 4 \cdot \binom{10}{3} + 6 \cdot \binom{4}{3} \\ &= 104 \end{align}

Related Question