Expected Value of Iterative Dice Rolling

Three 6-sided fair dice are rolled and their sum is recorded. If there were any dice with the same face value in the roll, only those dice are thrown again and their sum is added to the previous sum. This process is iterated until all numbers are distinct in the roll.

Here is an example:

  • Roll #1: 5 + 5 + 5 = 15 , \ 5 + 5 + 5=15, and the three 5's are rolled again.

  • Roll #2: 3 + 3 + 1 = 7 , \ 3 + 3 + 1=7, and the two 3's are rolled again. (The total is 15+7=22 for now.)

  • Roll #3: 4 + 1 = 5 , \ 4 + 1 =5, and nothing is rolled again because 4 and 1 are distinct. (The grand total is 15+7+5=27.)

What is the expected value of the grand total?


The answer is 14.4.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

7 solutions

Patrick Corn
Aug 27, 2018

Let E E be the expected value. There are three cases.

If we get three of a kind, the expected value is 1 6 ( 3 1 + 3 2 + + 3 6 ) + E = 10.5 + E . \frac16(3 \cdot 1 + 3 \cdot 2 + \cdots + 3 \cdot 6) + E = 10.5 + E. This happens with probability 1 36 . \frac1{36}.

If we get two of a kind, the expected value is 10.5 + E 2 , 10.5 + E_2, where E 2 E_2 is the expected value of the process starting with two dice. Note that the expected value of a two-of-a-kind set of three rolls is 10.5 by a symmetry argument: for every x x y xxy roll, there is a ( 7 x ) ( 7 x ) ( 7 y ) (7-x)(7-x)(7-y) roll, and the sum of those two roll sums is 21. 21.

If we get three different numbers, the expected value is 10.5 10.5 (by the same symmetry argument). This happens with probability 6 5 4 6 6 6 = 5 9 , \frac{6 \cdot 5 \cdot 4}{6 \cdot 6 \cdot 6} = \frac59, so the probability of two of a kind is 1 1 36 5 9 = 5 12 . 1-\frac1{36} - \frac59 = \frac5{12}.

So E = 1 36 ( 10.5 + E ) + 5 12 ( 10.5 + E 2 ) + 5 9 ( 10.5 ) E = 10.5 + 1 36 E + 5 12 E 2 35 36 E = 10.5 + 5 12 E 2 \begin{aligned} E &= \frac1{36}(10.5 + E) + \frac5{12}(10.5 + E_2) + \frac59 (10.5) \\ E &= 10.5 + \frac1{36} E + \frac5{12} E_2 \\ \frac{35}{36} E &= 10.5 + \frac5{12} E_2 \end{aligned}

To compute E 2 , E_2, there are two cases: two of a kind leads to an expected value of 7 + E 2 7 + E_2 and two different leads to 7 , 7, so we get the equation E 2 = 1 6 ( 7 + E 2 ) + 5 6 ( 7 ) = 7 + 1 6 E 2 , E_2 = \frac16(7 + E_2) + \frac56(7) = 7 + \frac16 E_2, which gives E 2 = 8.4. E_2 = 8.4. Plugging back in above gives E = 36 35 ( 10.5 + 5 12 8.4 ) = 14.4 . E = \frac{36}{35}\left(10.5 + \frac5{12} \cdot 8.4\right) = \fbox{14.4}.

I see something very similar to what I had but different in that we end up with different numbers. It is persuasive that both Patrick and Jeremy arrived at the same answer. When I have a few hours to spare I will revisit my reasoning.

Andrew Wilkins - 2 years, 9 months ago

I understood where the 10.5 came from, but I do not understand why you added an unknown number E to the 10.5. I thought the 10.5 was the expected value for each of [1] rolling 3 dice, [2] rolling 2 dice, and [3] rolling 1 die.

Kermit Rose - 2 years, 4 months ago

Log in to reply

If you mean [1] getting three of a kind [2] getting two of a kind [3] getting three different numbers, then the expected value of that roll is 10.5 in all three cases. But after cases [1] and [2] we are not done rolling dice, so the expected value of the sum is larger than 10.5.

Patrick Corn - 2 years, 4 months ago
John Ross
Sep 2, 2018

Let E 3 E_3 be the expected total for three dice, E 2 E_2 for two dice, and E 1 E_1 for one dice. It is straightforward to see that E 1 = 3.5 E_1=3.5 . For two dice, there is a 1 6 \dfrac 16 chance of having a double, so we can write the equation E 2 = 1 6 ( 7 + E 2 ) + 5 6 ( 7 ) E_2=\dfrac 16 (7+E_2) + \dfrac 56 (7) The first term in this equation is for if we roll a double in which case we have an expected value of 7 7 plus any more points we get from rolling the two dice again. The second term is for if we rolled two different numbers in which case we have expected value 7 7 . Solving for E 2 E_2 gives E 2 = 8.4 E_2=8.4 . For rolling three dice, rolling a triple has a 1 36 \dfrac{1}{36} chance, rolling exactly a double has a 5 12 \dfrac{5}{12} chance, and rolling three different values has a 5 9 \dfrac 59 chance. This leads to the equation E 3 = 1 36 ( 10.5 + E 3 ) + 5 12 ( 10.5 + E 2 ) + 5 9 ( 10.5 ) E_3=\dfrac{1}{36}(10.5+E_3)+\dfrac{5}{12}(10.5+E_2)+\dfrac 59 (10.5) by similar reasoning as before. Plugging in E 2 E_2 and solving for E 3 E_3 gives E 3 = 14.4 E_3=\boxed{14.4}

Calvin Osborne
Sep 3, 2018

This problem can be generalized to the case of n n dice, where if multiple matches appear in one roll all sets are re-rolled separately. Let μ n \mu_{n} denote the expected value for a roll of n n dice while not considering re-rolling. All we need to consider now is the expected values of the additional re-rolls, which we will call E n E_{n} , along with the probability for a group of x x dice to be the same, which we will denote P n ( x ) P_{n}(x) . The expected value for n n dice can then be represented as, E n = μ n + x = 2 n P n ( x ) E x = μ n + P n ( n ) E n + x = 2 n 1 P n ( x ) E x \begin{aligned} E_{n} &= \mu_{n} + \sum_{x=2}^{n} P_{n}(x)E_{x} \\ &= \mu_{n} + P_{n}(n)E_{n} + \sum_{x=2}^{n-1} P_{n}(x)E_{x} \end{aligned} E n = μ n + x = 2 n 1 P n ( x ) E x 1 P n ( n ) E_{n} = \frac{\mu_{n} + \sum_{x=2}^{n-1} P_{n}(x)E_{x}}{1 - P_{n}(n)}

To find μ n \mu_{n} we must add together 6 n 6^{n} groups of n n numbers, each with a 1 6 n \frac{1}{6^{n}} chance of occurring. Since each sum has the same probability, we can factor the probability out, and as we group the digits together their must be n 6 n 1 n6^{n-1} of each number 1 1 through 6 6 , so

μ n = 1 6 n ( n 6 n 1 ( 1 + 2 + 3 + 4 + 5 + 6 ) ) = 21 n 6 \mu_{n} = \frac{1}{6^{n}}(n6^{n-1}(1 + 2 + 3 + 4 + 5 + 6))=\frac{21n}{6}

We can write P n ( x ) P_{n}(x) explicitly be noting that you have 6 6 options for the same set number, 5 n x 5^{n - x} options for the remaining numbers, and the pair can be arranged ( n x ) \binom{n}{x} ways, so

P n ( x ) = 6 × 5 n x ( n x ) 6 n = 5 n x ( n x ) 6 n 1 P_{n}(x) = \frac{6 \times 5^{n - x} \binom{n}{x}}{6^{n}} = \frac{5^{n-x}\binom{n}{x}}{6^{n - 1}}

Finally note that P n ( n ) = 1 6 n 1 P_{n}(n) = \frac{1}{6^{n - 1}} , so

E n = μ n + x = 2 n 1 P n ( x ) E x 1 P n ( n ) = μ n + 1 6 n 1 x = 2 n 1 5 n x ( n x ) E x 6 n 1 1 6 n 1 = 21 n × 6 n 2 + x = 2 n 1 5 n x ( n x ) E x 6 n 1 1 = E n \begin{aligned} E_{n} &= \frac{\mu_{n} + \sum_{x=2}^{n-1} P_{n}(x)E_{x}}{1 - P_{n}(n)} \\ \\ &= \frac{\mu_{n} + \frac{1}{6^{n-1}}\sum_{x=2}^{n-1} 5^{n-x}\binom{n}{x}E_{x}}{\frac{6^{n-1} - 1}{6^{n-1}}} \\ \\ &= \dfrac{21n \times 6^{n-2} + \sum_{x=2}^{n-1} 5^{n-x}\binom{n}{x}E_{x}}{6^{n-1} - 1} = E_{n} \end{aligned}

With this equation we can find that E 2 = 8.4 E_{2} = 8.4 and E 3 = 14.4 E_{3} = \boxed{14.4}

I'm afraid that your generalization is incorrect when n > 3 n>3 . Your method fails to process the cases where more than 1 number is rolled multiple times. It works when this scenario is impossible, like for n = 2 , 3 n=2,3 , but with greater n n it yields wrong values. For example, E 4 E_{4} equals 21.6 21.6 , but according to your formula it should be 21.2651163 21.2651163 .

Uros Stojkovic - 2 years, 9 months ago

Log in to reply

How did you calculate that E 4 E_{4} should equal 21.6 21.6 ? Here's what I found when I calculated E 4 E_{4} without the formula:

The probability of rolling the same number for all 4 dice is clearly 6 6 4 = 1 216 \frac{6}{6^{4}} = \frac{1}{216} . The probability of rolling 3 of the same number is 6 × 5 × ( 4 3 ) 6 4 = 5 54 \frac{6 \times 5 \times \binom{4}{3}}{6^{4}} = \frac{5}{54} . The probability of rolling only one pair of the same number is 6 × 5 × 4 × ( 4 2 ) 6 4 = 5 9 \frac{6 \times 5 \times 4 \times \binom{4}{2}}{6^{4}} = \frac{5}{9} , while the probability of rolling two pairs of the same number is 6 × 5 × ( 4 2 ) / 2 6 4 = 5 72 \frac{6 \times 5 \times \binom{4}{2} / 2}{6^{4}} = \frac{5}{72} . Finally the probability of rolling all different numbers is 6 × 5 × 4 × 3 6 4 = 5 18 \frac{6 \times 5 \times 4 \times 3}{6^{4}} = \frac{5}{18} . The sum of these probabilities is 1 216 + 5 54 + 5 9 + 5 72 + 5 18 = 1 \frac{1}{216} + \frac{5}{54} + \frac{5}{9} + \frac{5}{72} + \frac{5}{18} = 1 , which is what we should find. Therefore we can find E 4 E_{4} by,

E 4 = 1 216 ( μ 4 + E 4 ) + 5 54 ( μ 4 + E 3 ) + 5 9 ( μ 4 + E 2 ) + 5 72 ( μ 4 + E 2 + E 2 ) + 5 18 ( μ 4 ) = 1 216 ( 14 + E 4 ) + 5 54 ( 14 + 14.4 ) + 5 9 ( 14 + 8.4 ) + 5 72 ( 14 + 8.4 + 8.4 ) + 5 18 ( 14 ) \begin{aligned} E_{4} &= \frac{1}{216}(\mu_{4} + E_{4}) + \frac{5}{54}(\mu_{4} + E_{3}) + \frac{5}{9}(\mu_{4} + E_{2}) + \frac{5}{72}(\mu_{4} + E_{2} + E_{2}) + \frac{5}{18}(\mu_{4}) \\ &= \frac{1}{216}(14 + E_{4}) + \frac{5}{54}(14 + 14.4) + \frac{5}{9}(14 + 8.4) + \frac{5}{72}(14 + 8.4 + 8.4) + \frac{5}{18}(14) \end{aligned}

Solving this formula for E 4 E_{4} , we find that E 4 = 4572 215 21.2651163 E_{4} = \boxed{\frac{4572}{215}} \approx 21.2651163 , which is what the formula calculated.

Calvin Osborne - 2 years, 9 months ago

Log in to reply

Oh, I see the "problem". I assumed that if more than 1 number is rolled multiple times, all dice showing these numbers are re-rolled and their results are treated together. However, I see now that you mentioned at the beginning of your generalization that "if multiple matches appear in one roll all sets are re-rolled separately". My apologies for the inconvenience.

Uros Stojkovic - 2 years, 9 months ago

Log in to reply

@Uros Stojkovic Oh no don't worry, I was honestly a bit concerned about that exact issue for when n > 3 n > 3 , so I created a python simulation to check the formula and it seemed to be correct, but I wasn't completely sure. This was a good way to check, thanks! Also, I decided to do all re-rolling seperatly because of how nice and logical it made the original equation E n = μ n + x = 2 n P n ( x ) E x E_{n} = \mu_{n} + \sum_{x=2}^{n} P_{n}(x)E_{x} .

Calvin Osborne - 2 years, 9 months ago
Joël Ganesh
Sep 7, 2018

Different from the current given solutions, I made a program in Python:

import random

i = 1

n = 2000000

value = 0

while i <= n:

a = random.randint(1, 6)

b = random.randint(1, 6)

c = random.randint(1, 6)

value = value + a + b + c

if a == b == c:

    i -= 0

elif a == b or b == c or a == c:

    j = 1

    while j == 1:

        d = random.randint(1, 6)

        e = random.randint(1, 6)

        value = value + d + e

        if d != e:

            j = 0

            i += 1

        else:

            j = 1

elif a != b and b != c and a != c:

    i += 1

print(str(value/(n)))

This code, which basically describes the process of n experiments as mentioned in the problem, will approximate the expected value by executing the code n times. When n gets bigger, the result of the experiments devided by n will tend more and more towards the expected value (if n approaches infinity, the results of the individual experiments devided by n will equal the expected value). So when setting n equal to a number big enough, the result will approximate the expected value. I used n = 2000000 (two million), and did the experiment 3 times. This is what got printed:

14.401035

14.3966635

14.4023505

Taking the average of the three got me 14.4000163 which is approximately 14.4.

Vinod Kumar
Sep 3, 2018

In rolling three dices, probability of three dices with same face is (1/36) and of two dices with same face is (15/36). The average sum of faces is 3×3.5=10.5

In rolling two dices, the probability of two dices with same face is (1/6). The average sum of faces is 2×3.5.

In the game defined in the problem, the iterated sum is given by:

(3×3.5){1+(1/36)+(1/36)^2+......}+ (15/36)(2×3.5){1+(1/6)+(1/6)^2+....}

= (3.5){3*(36/35)+1}=(3.5){143/35}

=14.3

Answer=14.3

My answer is 14.3 which is accepted by brilliant and posted here in the discussion. I didn't include the 2-dice iterated term in 3-dice iteration. If, I take three dice sum consistently, then, the expression can be rewritten to get answer Z as below:

2-dice term{iterated sum} = (15/36)(2×3.5){1+(1/6)+(1/6)^2+....} =3.5

3-dice term{non iterated sum}=10.5

Z= 10.5 + 3.5 +(10.5+3.5)*(1/36+(1/36)^2+(1/36)^3+......)

Z=14*(36/35)

Modified and Correct Answer=14.4

Are you taking into account the possibility of rolling three the same followed by two the same?

Jeremy Galvagni - 2 years, 9 months ago

Log in to reply

Thanks. You are right. My answer 14.3 was posted here in the discussion. If, I take 3-dice sum consistently after including 2-dice term, then, the expression can be rewritten to get answer Z as below:

10.5+3.5 +14*(1/36+(1/36)^2+...)=Z

Z=14*(36/35)

Answer=14.4

Vinod Kumar - 2 years, 9 months ago
Jeremy Galvagni
Sep 2, 2018

This isn't fully fleshed out, but it's how I convinced the OP his original answer was incorrect.

1st roll is 10.5 10.5 no matter what, but 90 216 \frac{90}{216} of getting doubles which expects 8.4 8.4 extra and 6 216 \frac{6}{216} of getting 3-of-a-kind which expects 14.4 14.4 extra. 10.5 + 8.4 90 216 + 14.4 6 216 = 14.4 10.5+8.4\cdot \frac{90}{216}+14.4\cdot \frac{6}{216}=14.4

To see the expected extra points for a matching pair consider the two dice version of the game. 7 + 7 1 6 + 7 1 6 2 + 7 1 6 3 . . . = 7 6 5 = 8.4 7 + 7 \cdot \frac{1}{6} + 7 \cdot \frac{1}{6^{2}} + 7\cdot \frac{1}{6^{3}} ... = 7\cdot \frac{6}{5} = 8.4

Similar reasoning for 3-of-a-kind.

My answer is 14.3 and posted here in the discussion. If, I take 3-dice sum consistently after including 2-dice term, then, the expression can be rewritten to get answer Z as below:

10.5+3.5 +14*(1/36+(1/36)^2+...)=Z

Z=14*(36/35)

Answer=14.4

Vinod Kumar - 2 years, 9 months ago
Andrew Wilkins
Aug 26, 2018

Still working on it - I keep changing my mind! I am not sure 22.8 is the right answer but I can't seem to get rid of it

improve more

improve more - 2 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...