In a certain exercise I am asked to find the probability of the event in which a dice is rolled seven times and the sum of the results is $14$, given the fact that the dize is regular (this is, the probability of each of the six possible results is the same: $\frac{1}{6}$.
I think I know the approach: let $X_i$ denote the random discrete variable that assigns each roll to the result, this is, $X_i = \{1 \dots 6\}$. Then, I consider the variable $Z = X_1 + \cdots X_7$, and I want to find $P(Z = 14)$. Note that each of the $X_i$ are uniform: each result has possibility $\frac{1}{6}$.
Is the sum of $n$ uniform discrete variables also a uniform one? Is there any trick to find this number (just a hint)? I would be grateful if somebody could give me his/her thoughts about the exercise, but not the full solution, just a hint (at least for the moment).
Define the following generating function: $f(x)=(x+x^2+x^3+...+x^6)^7$. The powers of $x$ correspond to the face value of the die and the power of $7$ indicates the fact that it is being rolled $7$ times. What we want is $[x^{14}]f(x)$; that is, the coefficient of the $x^{14}$ term.
Begin by factoring out $x$ from the expression. We are left with $f(x)=x^7(1+x+x^2+...+x^5)^7$. The right factor can be rewritten as $(\frac{1-x^6}{1-x})^7$, so $f(x)=x^7(\frac{1-x^6}{1-x})^7$.
If $g(x)$ is a function of $x$, it is a property of generating functions that $[x^n]=x^mg(x)=[x^{n-m}]g(x)$, so our problem is reduced to finding $[x^7](1-x^6)^7(1-x)^{-7}$.
Beginning with this, we see that there are $\binom{7}{1}=7$ ways of choosing a $x^6$ term from the first factor, which means we need an $x$ term from the second. There are $\binom{-7}{1}=\binom{7+1-1}{1}=\binom{7}{1}=7$ ways of doing so. Therefore there are $7\cdot7=49$ ways of making $x^7$ if $x^6$ is taken from the first factor. We must then remember to multiply this by $-1$ — one comes from $-x^6$, another from $-x$, and the last comes from the fact that $\binom{-n}{k}=\binom{n+k-1}{k}(-1)^k$, with $k=1$.
The next case would be choosing $7$ $x$ terms from the second factor. There are $\binom{-7}{7}=\binom{7+7-1}{7}(-1)^7=-\binom{13}{7}$ ways of doing so. Note that there is no need to multiply by $-1$ this time as the $(-1)^7$ multiplied by $(-x)^7$ equals just $x^7$.
So in total, the coefficient of $x^7$ in our modified generating function is $\binom{13}{7}-7\binom{7}{1}=1667$. This forms the numerator of our probability. The denominator consists of all possible outcomes, which is $6^7=279936$. The overall probability of getting a sum of $14$ is therefore equal to $\frac{1667}{279936}\approx 0.0059$