A single die is rolled until a run of six different faces appears. For example,one might roll the sequence 535463261536435344151612534 with only the last six rolls all distinct. The expected number of rolls to attain this can be written as b a , where a and b are positive coprime integers. Find a + b .
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.
We can model this scenario by a Markov process as follows: at any given stage let k be the largest integer such that "the last k die rolls are distinct" holds, and let S 0 , S 1 , … , S 6 be the states in which k = 0 , 1 , … , 6 respectively (of course, S 0 only occurs at the beginning before any rolls). Note that the current state precisely determines the probability distribution for the state after one more roll: for instance, from state S 4 there is a 6 2 chance of advancing to S 5 by rolling differently from the previous 4 values, and there is a 6 1 chance of transitioning to each of S 1 , S 2 , S 3 , S 4 by matching one of the previous 4 values.
Define E k to be the expected number of rolls required to reach state S 6 starting from S k . Then clearly E 6 = 0 , and we are looking for the value of E 0 = 1 + E 1 . The transitions between states now yield a system of equations for E k : for instance, E 4 = 1 + 6 2 E 5 + 6 1 ( E 1 + E 2 + E 3 + E 4 ) , reflecting that one roll after S 4 we could be in any one of S 1 , … , S 5 with the specified probabilities. Rearranging this gives the equation − E 1 − E 2 − E 3 + 5 E 4 − 2 E 5 = 6 .
Compiling these equations gives the linear system:
⎝ ⎜ ⎜ ⎜ ⎜ ⎛ 5 − 1 − 1 − 1 − 1 − 5 5 − 1 − 1 − 1 0 − 4 5 − 1 − 1 0 0 − 3 5 − 1 0 0 0 − 2 5 ⎠ ⎟ ⎟ ⎟ ⎟ ⎞ ⎝ ⎜ ⎜ ⎜ ⎜ ⎛ E 1 E 2 E 3 E 4 E 5 ⎠ ⎟ ⎟ ⎟ ⎟ ⎞ = ⎝ ⎜ ⎜ ⎜ ⎜ ⎛ 6 6 6 6 6 ⎠ ⎟ ⎟ ⎟ ⎟ ⎞
We suppress the gory details of solving this system (but note that the last two rows give E 4 = 6 7 E 5 and the middle three rows give − 3 E 1 + 3 E 2 + 2 E 4 − 2 E 5 = 1 8 , which combines with the first row to give E 4 − E 5 = 5 5 4 . In the end we find that ( E 1 , E 2 , E 3 , E 4 , E 5 ) = 5 1 ( 4 1 1 , 4 0 5 , 3 9 6 , 3 7 8 , 3 2 4 ) , so that E 0 = 1 + E 1 = 5 4 1 6 . Our final answer is 4 1 6 + 5 = 4 2 1 .
lol, I actually presented the gory details xD
We will keep track of the following states: S1: "streak" of 1 (e.g. your first flip, or you flip something that was the same as the one before). S2: "streak" of 2, S3, S4, S5 similarly. We have:
I'll use these S's as the expected number of flips to reach a state of 6 distinct flips.
S 1 = 1 + S 1 / 6 + 5 S 2 / 6 S 2 = 1 + S 1 / 6 + S 2 / 6 + 4 S 3 / 6 S 3 = 1 + S 1 / 6 + S 2 / 6 + S 3 / 6 + 3 S 4 / 6 S 4 = 1 + S 1 / 6 + S 2 / 6 + S 3 / 6 + S 4 / 6 + 2 S 5 / 6 S 5 = 1 + S 1 / 6 + S 2 / 6 + S 3 / 6 + S 4 / 6 + S 5 / 6
How did we get these equations? Note that if you are on a streak of x, then you have a (6-x)/6 chance of continuing the streak (6-x numbers remaining), and an x/6 chance of breaking it. For the x/6 chance, you have an equal chance of regressing back to one of the earlier streaks (including the streak you are on.) To illustrate this, consider a streak of 3, e.g. 1123. If you roll a 1, 2, or 3, you do not extend your streak. But they have different effects. If you roll a 1, you still have a streak of 3. If you roll a 2, it's a streak of 2 (232 => 32). If you roll a 3, you must start over at a streak of 1.
(The 1+ is due to the fact that we have increased the roll count by 1.)
Anyway. Now that we have explained that, let's now solve the above!
But not so fast. We can speed this up significantly by noting that the equations are quite similar to each other. And with that, subtracting consecutive equations sounds like a good idea. We get the following:
S 1 − S 2 = 4 S 2 / 6 − 4 S 3 / 6 S 2 − S 3 = 3 S 3 / 6 − 3 S 4 / 6 S 3 − S 4 = 2 S 4 / 6 − 2 S 5 / 6 S 4 − S 5 = S 5 / 6
We might as well solve for the first equation by itself to get S 1 − S 2 = 6 / 5 . From here, we can get the other differences quite easily: S 2 − S 3 = 6 / 5 ⋅ 6 / 4 = 9 / 5 ; S 3 − S 4 = 9 / 5 ⋅ 6 / 3 = 1 8 / 5 ; S 4 − S 5 = 1 8 / 5 ⋅ 6 / 2 = 5 4 / 5 ; S 5 = 5 4 / 5 ⋅ 6 = 3 2 4 / 5 . And we add it all up and get S 1 = 3 2 4 / 5 + 5 4 / 5 + 1 8 / 5 + 9 / 5 + 6 / 5 = 4 1 1 / 5 .
But we have forgotten to account for the first flip that lands us at a streak of 1 in the first place, so our answer is 5 4 1 6 → 4 1 6 + 5 = 4 2 1 .
Problem Loading...
Note Loading...
Set Loading...
Here is a much simpler approach.
Imagine that a gambler in a fair casino takes the following strategy: in the first round he (very boringly) bets $1 that a die will land on one of 1,2,3,4,5,6. He then takes his winnings ($1) and gambles that the next roll will be different to the first roll, which happens with probability 6 5 . If he wins then he takes his winnings ( 5 6 ) and gambles that the next number will be one of the four which have not come up, and so on. He keeps this going: staking all his winnings on an unmatched number coming up until a streak of 6 unmatched numbers has been observed. Of course whenever there is a repeat he will lose all his money.
Now what the gambler does is start such a sequence of bets at each roll taking a new $1 from his pocket. He gambles until there is a string of distinct rolls. At this point the money from his live bets well be 5 6 × 4 6 × 3 6 × 2 6 × 1 6 = 5 3 2 4 from the six roll accumulator, plus 5 6 × 4 6 × 3 6 × 2 6 from the five roll accumulator, down to $ 1 from the one roll accumulator. This gives him total winnings of $ 5 4 1 6
However since the casino is fair this $ 5 4 1 6 on average will equal the money he has put in from his fortune. Since he gambles $1 each round, we know that the average wait for 6 distinct rolls is just $ 5 4 1 6