This week’s Fiddler is a probability question about a dice-rolling game.

Two people are sitting at a table together, each with their own bag of six “DnD dice”: a d4, a d6, a d8, a d10, a d12, and a d20. Here, “dX” refers to a die with X faces, numbered from 1 to X, each with an equally likely probability of being rolled. Both people randomly pick one die from their respective bags and then roll them at the same time. For example, suppose the two dice selected are a d4 and a d12. The players roll them, and let’s further suppose that both rolls come up as 3. What luck! What’s the probability of something like this happening? That is, what is the probability that both players roll the same number, whether or not they happened to pick the same kind of die?

*Extra Credit*

Instead of two people sitting at the table, now suppose there are three. Again, all three randomly pick one die from their respective bags and roll them at the same time. For example, suppose the three dice selected are a d4, a d20, and a d12. The players roll them, and let’s further suppose that the d4 comes out as 4, the d20 comes out as 13, and the d12 comes out as 4. In this case, there are two distinct numbers (4 and 13) among the three rolls. On average, how many distinct numbers would you expect to see among the three rolls?

My solution:

[Show Solution]

Each person performs two actions: selecting a die at random, and rolling that die. In the language of probability, the sample space (the set of all things that can occur) is $(n,d)$, where $d$ is the selected die, and $n$ is the number that is rolled. The probability of picking the die $d$ and rolling a $n$ is given by:

\[

p_{n,d} = \frac{1}{6} \times \begin{cases}

\frac{1}{d} & \text{if }1 \leq n \leq d \\

0 & \text{otherwise}

\end{cases}

\]The $\frac{1}{6}$ comes from the fact that there are six different dice, each equally likely to be picked. Arranging these probabilities in a table, we obtain:

\[

p_{n,d} = \frac{1}{6}\begin{bmatrix}

\frac{1}{4} & \frac{1}{6} & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

\frac{1}{4} & \frac{1}{6} & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

\frac{1}{4} & \frac{1}{6} & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

\frac{1}{4} & \frac{1}{6} & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & \frac{1}{6} & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & \frac{1}{6} & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & \frac{1}{8} & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & 0 & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & 0 & \frac{1}{10} & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & 0 & 0 & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & 0 & 0 & \frac{1}{12} & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20} \\

0 & 0 & 0 & 0 & 0 & \frac{1}{20}

\end{bmatrix}

\quad \implies \quad p_n = \begin{bmatrix}

\frac{31}{240} \\ \frac{31}{240} \\ \frac{31}{240} \\ \frac{31}{240} \\

\frac{7}{80} \\ \frac{7}{80} \\ \frac{43}{720} \\ \frac{43}{720} \\

\frac{7}{180} \\ \frac{7}{180} \\

\frac{1}{45} \\ \frac{1}{45} \\

\frac{1}{120} \\ \frac{1}{120} \\ \frac{1}{120} \\ \frac{1}{120} \\ \frac{1}{120} \\ \frac{1}{120} \\ \frac{1}{120} \\ \frac{1}{120}

\end{bmatrix}

\]In the matrix on the left, each column corresponds to a different die and each row corresponds to a different number. All the numbers in this table sum to 1 (this is a joint distribution). The column vector on the right is what you get when you sum across rows. These numbers again sum to 1 and form what is called a marginal distribution. This is the probability distribution for the dice rolls regardless of which die was picked. Picking one of the dice at random, then rolling it, is the same as rolling a single *weighted* 20-sided die whose weights are given by the marginal distribution above. We can plot this distribution as a graph, and we get the following:

From now on, I will write $p_n$ to denote the (marginal) probability of rolling the number $n$.

### The first problem

The first problem asks for the probability that both players roll the same number (regardless of which die they chose). The probability that both players roll $n$ is $p_n^2$. Therefore, the probability that they both roll the same number is

\[

\sum_{n=1}^{20} p_n^2 = \frac{3}{32} = 0.09375

\]Therefore, the probability that both players roll the same number is approximately 9%.

### The extra credit

We now have 3 players, and we are asked to find the expected number of distinct rolls. We can calculate the probability of each in turn.

- The probability of obtaining one distinct number (all three players roll the same number) is similar to the case with two players rolling the same number, except now it’s $p_n^3$. Therefore,

\[

q_1 = \sum_{n=1}^{20}p_n^3 = \frac{32753}{3110400} \approx 0.01053

\]
- The probability of obtaining two distinct numbers is a bit more complicated. We have to count how many ways we can pick two players that will have the same number $n$, which is $\binom{3}{2}p_n^2$, and then the third player can have any of the remaining numbers, so we multiply by $(1-p_n)$. Therefore,

\[

q_2 = \sum_{n=1}^{20}\binom{3}{2}p_n^2(1-p_n) = \frac{258847}{1036800} \approx 0.24966

\]
- Finally, the probability of obtaining three distinct numbers is the leftover probability after excluding the first two cases above:

\[

q_3 = 1-q_1-q_2 = \frac{1150553}{1555200} \approx 0.73981

\]

We can calculate the expected number of distinct rolls by multiplying each probability above by the number of distinct rolls and summing them up:

\begin{align}

\mathbb{E}(\text{distinct numbers})

&= q_1 + 2q_2 + 3q_3

= \frac{8489153}{3110400}

\approx 2.72928

\end{align}

Therefore, we would expect to see, on average, 2.729 distinct numbers among the three dice rolls.