Misha rolls a standard, fair six-sided die until she rolls 1−2−3 in that order on three consecutive rolls. The probability that she will roll the die an odd number of times is nm where m and n are relatively prime positive integers. Find m+n.
解析
Solution 0
Let Pn be the probability of getting consecutive 1,2,3 rolls in n rolls and not rolling 1,2,3 prior to the nth roll.
Let x=P3+P5+...=1−(P4+P6+..). Following Solution 2, one can see that
Pn+1=Pn−63Pn−2
for all positive integers n≥5. Summing for n=5,7,... gives
Let Podd=nm, with the subscript indicating an odd number of rolls. Then Peven=1−nm.
The ratio of PevenPodd is just 1−PoddPodd.
We see that Podd is the sum of P3,P5,P7,... , while Peven is the sum of P4, P6, P8,... .
P3, the probability of getting rolls of 1-2-3 in exactly 3 rolls, is obviously 2161.
We set this probability of P3 aside, meaning we totally remove the chance of getting 1-2-3 in 3 rolls. Now the ratio of P4+P6+P8+... to P5+P7+P9+... should be equal to the ratio of PevenPodd, because in this case the 1st roll no longer matters, so we can disregard the very existence of it in counting how many times of rolls, and thus, 4 rolls, 6 rolls, 8 rolls... would become an odd number of rolls (while 5 rolls, 7 rolls, 9 rolls... would become even number of rolls).
Notice P4+P6+P8+...=Peven, and also P5+P7+P9+...=Podd−P3=Podd−2161
So we have Podd−2161Peven=PevenPodd.
Finally, we get Podd=nm=431216. Therefore, m+n=647.
Solution 2
Call the probability you win on a certain toss fn, where n is the toss number. Obviously, since the sequence has length 3, f1=0 and f2=0. Additionally, f3=(61)3. We can call this value x, to keep our further equations looking clean. We can now write our general form for f as fn=x(1−∑i=1n−3fi). This factors the probability of the last 3 rolls being 1-2-3, and the important probability that the sequence has not been rolled in the past (because then the game would already be over). Note that ∑i=1∞fi=1 since you'll win at some point. An intermediate step here is figuring out fn−fn+1. This is equal to x(1−∑i=1n−3fi)−x(1−∑i=1n−2fi)=x(∑i=1n−2fi−∑i=1n−3fi)=xfn−2. Adding up all the differences, i.e. ∑i=2∞(f2n−1−f2n) will give us the amount by which the odds probability exceeds the even probability. Since they sum to 1, that means the odds probability will be half of the difference above one-half. Subbing in our earlier result from the intermediate step, the odd probability is equal to 21+21x∑i=2∞f2n−3. Another way to find the odd probability is simply summing it up, which turns out to be ∑i=1∞f2n−1. Note the infinite sums in both expressions are equal; let's call it P. Equating them gives 21+21xP=P, or P=2−x1. Finally, substituting x=2161, we find that P=431216, giving us a final answer of 216+431=647.
~First
Solution 3
Let S(n) be the number of strings of length n containing the digits 1 through 6 that do not contain the string 123. Then we have S(n)=6⋅S(n−1)−S(n−3) because we can add any digit to end of a string with length n−1 but we have to subtract all the strings that end in 123. We rewrite this as
S(n)=6⋅S(n−1)−S(n−3)=6⋅(6⋅S(n−2)−S(n−4))−(6⋅(S(n−4)−S(n−6))=36⋅S(n−2)−12⋅S(n−4)+S(n−6)
We wish to compute P=∑n=0∞62n+3S(2n) since the last three rolls are 123 for the game to end. Summing over the recursion, we obtain
n=0∑∞62n+3S(2n)=36⋅n=0∑∞62n+3S(2n−2)−12⋅n=0∑∞62n+3S(2n−4)+n=0∑∞62n+3S(2n−6)
Now shift the indices so that the inside term is the same:
n=3∑∞62n+3S(2n)(P−63S(0)−65S(2)−67S(4))=6236⋅n=2∑∞62n+3S(2n)−6412⋅n=1∑∞62n+3S(2n)+661⋅n=0∑∞62n+3S(2n)=6236⋅(P−63S(0)−65S(2))−6412⋅(P−63S(0))+661⋅P
Note that S(0)=1,S(2)=36 and S(4)=64−2⋅6=1284. Therefore,
(P−631−6536−671284)=6236⋅(P−631−6536)−6412⋅(P−631)+661⋅P
Solving for P, we obtain P=431216⟹m+n=647.
-Vfire
Solution 4
Let A=615440111001000010. A is a transition matrix for the prefix of 1-2-3 matched so far. The state corresponding to a complete match has no outgoing probability mass. The probability that we roll the dice exactly k times is (Ak)1,4. Thus the probability that we roll the dice an odd number of times is 1−(∑k=0∞A2k)1,4=1−((I−A2)−1)1,4=431216. Thus the answer is 216+431=647.
Solution 5 (quick cheat)
Consider it as a contest of Odd and Even. Let Po and Pe be probability that Odd and Even wins, respectively. If we consider every 3 rolls as an atomic action, then we can have a simple solution. If the rolls is 1-2-3, Odd wins; otherwise, Odd and Even switch the odds of winning. Therefore, we have
Po=2161+216215Pe
Plug in Pe=1−Po and we can easily solve for Po=431216.
647.
Of course this is not a rigorous solution. I think it works because the requirement is a strict sequence of pure random events.
-Mathdummy
Solution 6 (Markov Chain)
Main article: Markov Chains
Let Po, Pe be the winning probabilities respectively. We call Odd "in position" when a new sequence of 1-2-3 starts at odd position, and likewise, call Even is "in position" when a new sequence starts at even position.
Now, consider the situation when the first roll is 1. The conditional probability for Odd or Even to eventually win out depends on whose is in position. So let's denote by Po(1),Pe(1) the probabilities of Odd and Even winning out, respectively, both when Odd is in position. Remember that the probabilities simply switch if Even is in position. Similarly, after 1-2 is rolled, we denote by Po(2),Pe(2) the conditional probabilities of Odd and Even winning out, when Odd is in position.
Consider the first roll. If it's not a 1, the sequence restarts, but Even is now in position; if it's a 1, then Odd's winning probability becomes Po(1). So,
Po=61Po(1)+65Pe
In the next roll, there are 3 outcomes. If the roll is 2, then Odd's winning probability becomes Po(2); if the roll is 1, then we stay in the sequence, but Even is now in position, so the probability of Odd winning now becomes Pe(1); if the rolls is any other number, then the sequence restarts, and Odd is still in position. So,
Po(1)=61Po(2)+61Pe(1)+64Po
In the next roll after a 1-2 sequence, there are 3 outcomes. If the roll is a 3, Odd wins; if it's a 1, we go back to the state when 1 is just rolled, and Odd is in position; if it's any other number, then the sequence restarts, and Even is in position. So,
Po(2)=61+61Po(1)+64Pe
Plug in Pe=1−Po and Pe(1)=1−Po(1), we have a 3-equation linear system which is not hard to solve. The final answer is Po=431216. 647. (We want P_o because if it starts odd, it will also end odd)
-Mathdummy
Markov Chain Diagram
mathboy282
LATEX done by CrazyVideoGamez
Solution 7(Blocks)
Take a block of any three possible rolls. You have 63 different possibilities for a block and 63−1 different possibilities to have a block without 1-2-3. This gives two probabilities of 6363−1 and 631, respectively. To get an odd number of total rolls, we need an even number of blocks without a 1-2-3. Then, we can sum up the probabilities up to infinity to see the total probability of getting an even number of rolls.
631k=0∑∞(6363−1)2k=1−(6363−1)2631
Using difference of squares on the bottom half we can reduce it to (1−6363−1)(1+6363−1)=(63)22×63−1. Plugging this back in to the equation we get-
(63)22×63−1631=2×63−163=431216
Then, our answer is 647 -Mathiscool109
Solution 8 (Recursion)
Let the Po be the probability that Misha will roll the die an odd number of times, Pe be the probability that Misha will roll the die an even number of times.
Let Pn be the probability Misha ends after rolling n number of times.
Ending at n has two requirements: The last three rolls are 1,2,3, and there can't exist any 1,2,3 in previous rolls, which causes Misha end at a k<n.
It is easy to see that P3=−(61)3=2161 with only one case of 1,2,3. Also, PoandPe should be complementary values. Therefore we get two equations for two unknown variables:
{Po−2161=216215PePo+Pe=1
So 216431⋅Pe=216215, and Pe=431215