Sum of $5$ dice: Number of solutions diophantine equation

129 Views Asked by At

Calculate the probability that, when we throw $5$ dice, their sum is $18$. To do this, I figured I need to know how many solutions does this diophantine equation have: $$\left \{\begin{array}[c] xx_1+x_2+x_3+x_4+x_5=18 \\ 1\leq x_i \leq 6 \end{array} \right \}$$ (Then I calculate the probability knowing that the total amount of possible outcomes is $6^5$). However I don't know how to calculate the amount of solutions of the equation. Can someone help me?

1

There are 1 best solutions below

3
On BEST ANSWER

Here an approach by generating functions:

The numbers of solution with the given constraints is $$[x^{18}](x+\cdots+x^6)^5.$$ Thus, \begin{align} [x^{18}](x+\cdots+x^6)^5 &=[x^{18}]x^5(1+x+\cdots+x^5)^5\\ &=[x^{18}]x^5\left(\frac{1-x^6}{1-x}\right)^5\\ &=[x^{18}]x^5(1-x^6)^5\sum_{n=0}^\infty\binom{n+4}{4}x^n\\ &=[x^{13}](1-x^6)^5\sum_{n=0}^\infty\binom{n+4}{4}x^n\\ &=[x^{13}](1-5x^6+10x^{12})\sum_{n=0}^\infty\binom{n+4}{4}x^n\\ &=\binom{17}{4}-5\binom{11}{4}+10\binom{5}{4}\\ &=780. \end{align}

Thus, the numbers of solutions is 780.