Generating Function Example
Dices Generating Function Example
Assume we got two dice ($m=2$). Each die ranges from $1$ to $6$.
\[
\begin{split}
G(x) = (\sum_{i=1}^{6} x^i) * (\sum_{i=1}^{6} x^i)\\
= (x+x^2+x^3+x^4+x^5+x^6)^2 \\
=
x^2 +
2 x^3 +
3 x^4 +
4 x^5 +
5 x^6 +
6 x^7 + \\
5 x^8 +
4 x^9 +
3 x^{10} +
2 x^{11} +
x^{12}
\end{split}
\]
π You can use online tools to expand expressions (ex: wolframalpha).
- $card(\text{"A=The sum is 1"}) = 1$
- ...
- $card(\text{"A=The sum is 7"}) = 6$
- $card(\text{"A=The sum is 8"}) = 5$
- ...
We are reading the coefficients to get the cardinal.