Optimus Prime loves prime numbers . So, he decides to keep rolling a fair six-sided die, until he rolls a prime number less than 100. e.g. If his last two rolls were a 6 and then a 1, he would be done since 61 is a prime number. Or, for example, any time he rolls a 3 he would also be done since 3 is a prime number.
If the expected number of rolls he must make is b a , where a and b are coprime positive integers , what is 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.
I get the first 2 equations. Can't seem to get my head around the last 2. Any extra explanation?
Simpler: if there has been at least one roll and we're still going, rolling a 1 is also a success, because the previous roll must be one of 1, 4, 6 and all of 11, 41, 61 are primes. Thus given that there is a previous roll, the expected number of rolls E ′ satisfies E ′ = 1 + 3 1 E ′ , or E ′ = 2 3 . At the beginning, there is no previous roll; either we roll 2, 3, or 5 and we win, or otherwise we need an expected number of 1 + E ′ rolls (1 for the first roll, E ′ for the rest).
Log in to reply
Ah yes, very nice! ;)
Log in to reply
And to finish off Ivan's logic here... E = 1 + ( 1 / 2 ) E ′ = 1 + ( 1 / 2 ) ( 3 / 2 ) = 7 / 4 7 + 4 = 1 1
Can you please explain how you got these equations? Thank you!
Consider states 0, 1, 4, and 6 labeled by what the last number you rolled is (except for 0 which is the state you start in). So, E n = The expected number of rolls from state n. Then you can derive the above equations, for example for E 1, from state 1 you use up 1 move (the first term, 1) and you have 1/6 probability of getting to 4, or 6. This translates to the second equation in the solution. You set up similar equations for 0, 4 and 6.
Make sense?
Why is 3 not considered as the second number. 13 is prime.
You only consider non primes.
The non primes for 4 are 44 and 46. You don't include 42 or 45 since 2 and 5 are prime.
Same with 6.
Problem Loading...
Note Loading...
Set Loading...
Let E n = The expected number of remaining rolls given that n was the last number rolled.
Since 2, 3, and 5 are all prime, clearly E 2 = E 3 = E 5 = 0 .
Also, the only two digit primes starting with 1, 4 or 6 and ending with 1, 4, or 6 are 11, 41, and 61. Translating this to a set of linear equations, you get:
The above equations are derived by considering states 0 , 1 , 4 , and 6 labeled by what the last number you rolled is (except for 0 which is the state you start in). So, E n = The expected number of rolls from state n . Then you can derive the above equations, for example for E 1 , from state 1 you use up 1 roll (the first term, 1 ) and you have 1 / 6 probability of getting to 4 or 6 . This translates to the second equation in the solution. You set up similar equations for 0 , 4 and 6 .
Solving for E 0 , you get, E 0 = 7 / 4
7 + 4 = 1 1