A game with two dice

Imagine a game with two dice, played by two people and a referee.
The referee rolls the first die and the number will determine the number of times that the second die will be rolled.
The two players never know the result of the first die and they must place bets on the total outcome (the sum of the numbers rolled with the second die). They can review the bet each time after the second die is rolled.
With two regular (1:6) dice, and before any die is rolled, there are 55986 different combinations (6^6+6^5+…6^1), that will sum up in 36 total (from 1 to 36).
My question is: how can I calculate the probability of each sum (from 1 to 36) without brute force?

I attach a simple example with two dice of (1:3) instead of (1:6); in this case we have 3^3+3^2+3^1=39 combinations and it is easy to use brute force.

The probabilities of the dice outcomes are:

enter image description here

enter image description here

Solutions Collecting From Web of "A game with two dice"

You could use probability generating functions (PGFs) to model the situation. The PGF for rolling the first die is $\frac{1}{6}(z^{1}+\dots+z^{6})$ . The exponents label the pips of the die, the coefficients give the number of occurrences of an event, weighted with the probability $\frac{1}{6}$ for each occurrence. To model the roll(s) of the second die $z$ is substituted by $z\mapsto\frac{1}{6}(x^{1}+\ldots+x^{6})$, since for each pip the second die will be rolled once. So, the PGF for the rolls of the second die is

$$A(x)\mathrel{\mathop:}=\frac{1}{6}\sum_{k=1}^{6}\frac{1}{6^{k}}\left(x^{1}+\dots+x^{6}\right)^{k}$$

To calculate the wanted probabilities for the resulting sums $1,\ldots,36$, we have to determine the coefficients $[x^{t}]$ of $x^{t}$ in $A(x)$ for each $t\in{1,\ldots,36}$. So,

\begin{eqnarray}
[x^{t}]A(x)
&=&[x^{t}]\sum_{k=1}^{6}\frac{1}{6^{k+1}}x^{k}\left(\sum_{j=0}^{5}x^{j}\right)^{k}\\
&=&\sum_{k=1}^{6}\frac{1}{6^{k+1}}[x^{t-k}]\left(\frac{1-x^{6}}{1-x}\right)^{k}\\
&=&\sum_{k=1}^{6}\frac{1}{6^{k+1}}[x^{t-k}]\sum_{j=0}^{k}(-1)^{j}\binom{k}{j}x^{6j}\frac{1}{(1-x)^{k}}\\
&=&\sum_{k=1}^{6}\frac{1}{6^{k+1}}\sum_{j=0}^{k}(-1)^{j}\binom{k}{j}[x^{t-k-6j}]\sum_{l\geq0}\binom{-k}{l}(-x)^{l}\\
&=&\sum_{k=1}^{6}\frac{1}{6^{k+1}}\sum_{j=0}^{k}(-1)^{j}\binom{k}{j}[x^{t-k-6j}]\sum_{l\geq0}\binom{k+l-1}{l}x^{l}\\
&=&\sum_{k=1}^{6}\frac{1}{6^{k+1}}\sum_{{j=0}\atop{t-6j-1\ge0}}^{k}(-1)^{j}\binom{k}{j}\binom{t-6j-1}{t-6j-k}
\end{eqnarray}

Finally,

$$
[x^{t}]A(x)=\sum_{k=1}^{6}\frac{1}{6^{k+1}}\sum_{{j=0}\atop{t-6j\ge1}}^{k}(-1)^{j}\binom{k}{j}\binom{t-6j-1}{k-1}\qquad\qquad t=1,\ldots,36
$$

Which $t$ would you choose for a bet? 🙂

Note: The polynomial in $z$ encodes the probability distribution of rolling the first die. E.g. $z^4$ encodes the event: rolling a $4$. So, $z^1+\dots+z^6$ encodes all possible events, namely rolling $1,\dots,6$. These events are weighted with the probability of occurrence, giving a total of $1/6\cdot(1+\dots+1)=(1/6)\cdot 6=1$. How is $4$ encoded when rolling the second die? Since, we have to roll the second die four times, the contribution is $(x^1+\dots+x^6)^4$. Expansion of this expression shows that all $6^4$ quadruples from $(1,1,1,1) \mapsto x^1x^1x^1x^1$ up to $(6,6,6,6) \mapsto x^6x^6x^6x^6$ are encoded. This is weighted with the probability ${(1/6)}^4$ according to the number of possible 4-tuples. But, rolling a $4$ (first die) occurs only in $1$ out of $6$ cases, so we have to multiply with an additional factor $1/6$ resulting in ${(1/6)}^5$.

Let the first dice have $n$ faces, and the second dice have $m$ faces.

Let $D(i,m)$ denote the pdf for the sum of $i$ rolls of a $m$-sided die. Note that it has mean $i \times \frac{m+1}{2}$ and standard deviation $i \times \frac{m^2-1}{12}$

Then, the total pdf can be expressed as

$$ \sum_{i=1}^n \frac{1}{n} PDF ( D(i,m) )$$

We (abuse) use the central limit theorem, for large $n$, which gives us

$ D(i,m) \sim N(i \times \frac{m+1}{2},i \times \frac{m^2-1}{12}) $

It is then much easier to determine the probability.

I am afraid you cannot, in the sense that there will not be any general formula where you can simply plug the value of the sum S, and obtain probability.

Here’s the best that I can do though.

  • Obtain the number of possible ways a sum, say $S$ can be achieved, i.e, the number of solutions of the equation, $$x_1 + x_2 +\cdots +x_6 = S \text{ for } 0 \le x_i \le6$$

  • There will be solutions where some $x_i = 0$. The number of non-zero $x_i$ is equal to the original number on the first dice.

  • The probability of that particular number occurring is $\frac16$. And the probabilities of any one solution occuring are all equal.

  • Thus we may conclude, the relative odds of a total sum, is the number of ways said sum may be achieved.

Not sure though, and there may be better ways to calculate. Marking as community-wiki.