# Dice rolls-Generating Functions

Let $d_n$ be the number of ordered sequences of die rolls (i.e., sequences of integers from $1$ to $6$) that add up to $n$. For example, $d_4=8$, because a total of $4$ can be rolled in $8$ ways:

$$\begin{array}{*4c} 4 & 3+1 & 2+2 & 1+3 \\ \\ ~2+1+1~ & ~1+2+1~ & ~1+1+2~ & ~1+1+1+1~ \end{array}$$ and $d_0=1$, since $0$ can be rolled in one way (roll no dice).

Let $D(x)$ be the generating function $$D(x) = d_0 + d_1x + d_2x^2 + d_3x^3 + \cdots .$$ Then $\frac 1{D(x)}$ is a polynomial. What polynomial is it?

• PiComedian used "find polynomial", it is not very effective. – Jorge Fernández Hidalgo Feb 23 '16 at 3:09
• You know about geometric series? – Masacroso Feb 23 '16 at 3:16

It is easy to see $d_k$ is the coefficient of $x^k$ in $\sum\limits_{n=0}^k(x+x^2+x^3+x^4+x^5+x^6)^n$.
From here $D(x)=\sum\limits_{n=0}^\infty(x+x^2+x^3+x^4+x^5+x^6)^n=\frac{1}{1-(x+x^2+x^3+x^4+x^5+x^6)}$.
Therefore $\frac{1}{D(X)}=1-x-x^2-x^3-x^4-x^5-x^6$.