Roll a fair six-sided die until you roll a number that is less than one of your previous rolls. To three decimal places, what is the expected value of the number of rolls made?
Bonus : Suppose you rolled a fair n -sided die instead. What is the expected value of the number of rolls made?
Extra Bonus : As n → ∞ , what does the expected value of the number of rolls approach?
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.
:thumbsup:
I'd like to add yet another question to the three that Andy asked: Suppose we only wanted to show that the expected value decreases as n increases. Is there an easy way to do so?
It's common sense that the smaller n is, the greater the chance of re-rolling the same number that was just rolled, which should mean a larger EV all other things being equal but I don't think that by itself is a complete explanation.
Log in to reply
Certainly P [ X > N ] is an decreasing function of n for any N ≥ 1 , since P [ X > N ] = N ! 1 j = 1 ∏ N − 1 ( 1 + n j ) but I suspect that that is not easy enough!
Hello, can you tell me the method or formula you used to calculate the infinite serie of binomials at the end of the proof?
Log in to reply
The Inverse, or generalised, Binomial Theorem.
Relevant wiki: Law of Iterated Expectation
Let X be the number of rolls until a lesser number is rolled. Now let the following conditional expected values be defined:
a = E [ X ∣ 1 ] = The expected value of the number of rolls given that the most recent roll was 1.
b = E [ X ∣ 2 ] = The expected value of the number of rolls given that the most recent roll was 2.
c = E [ X ∣ 3 ] = The expected value of the number of rolls given that the most recent roll was 3.
d = E [ X ∣ 4 ] = The expected value of the number of rolls given that the most recent roll was 4.
e = E [ X ∣ 5 ] = The expected value of the number of rolls given that the most recent roll was 5.
f = E [ X ∣ 6 ] = The expected value of the number of rolls given that the most recent roll was 6.
It's easier to solve for f first and then work your way backwards. Due to linearity of expectation:
f f e e d d = 6 1 ( 1 + f ) + 6 5 ( 1 ) = 5 6 = 6 1 ( 1 + f ) + 6 1 ( 1 + e ) + 6 4 ( 1 ) = ( 5 6 ) 2 = 6 1 ( 1 + f ) + 6 1 ( 1 + e ) + 6 1 ( 1 + d ) + 6 3 ( 1 ) = ( 5 6 ) 3
One might notice a pattern at this point. It just so happens that this pattern holds, and a = ( 5 6 ) 6 . Then note that E [ X ] = E [ X ∣ 1 ] . Then the expected number of rolls is ( 5 6 ) 6 ≈ 2 . 9 8 6 .
I don't get it. why is E [ X ] = E [ X ∣ 1 ] .
Log in to reply
There are no rolls less than 1, so rolling a 1 means that you are essentially back where you started.
Why is it f=1/6 (1+f) + 5/6(1). I would really appreciate it you could explain further.
Log in to reply
f represents the expected number of rolls after rolling a 6. After rolling a 6, there is a 1/6 probability that you would roll a 6 again, and a 5/6 probability that you would roll lower than a 6. If you roll a 6, then the expected number of rolls from that point on is f plus 1 for the roll you just made. If you roll lower than a 6, then you add 1 for the roll just made, but there are no more rolls after that.
Linearity of expectation allows one to add expected values and write equations like this. Check out the wiki if you'd like to learn more.
Log in to reply
Why wouldn't in the quation for e the number added by the probability of rolling 6,not be 1/6(1+e),why is it 1/6(1+f)?
Log in to reply
@Yasoda Gamage – e represents the expected number of rolls after rolling a 5. After rolling a 5, there is a 1/6 probability that you would roll a 6, a 1/6 probability that you would roll a 5, and a 4/6 probability that you would roll lower than a 5. If you roll a 6, then the expected number of rolls from that point on is f plus 1 for the roll you just made. If you roll lower than a 5, then the expected number of rolls from that point on is e plus 1 for the roll you just made. If you roll lower then a 5, then you add 1 for the roll just made, but there are no more rolls after that.
Log in to reply
@Andy Hayes – But if you roll a 6 after rolling a 5,shouldn't the contribution to the expected number of rolls for the next roll to be less than 5,still be e+1,not f+1?
Log in to reply
@Yasoda Gamage – There's 3 possible things that could happen after you roll a 5:
I think you mean first roll and not last roll
Log in to reply
Actually, I meant "last roll" as in "the most recent roll previous to this one." I will change the language in the solution.
I get it now
This is a very elegant approach, I've been trying to do it using this formula: E(x) = 2 P(2)+3 P(3)+...N*P(N)
I've managed to figure out that P(2)=15/36 but I can't find a formula for P(N)
Relevant wiki: Monte-Carlo Simulation
Cheater's ( Monte Carlo ) solution:
This takes me about 30 seconds to run with python 2.7 and less than 2 seconds with pypy. It will usually get the correct answer. Running it 3 times gave me the same number for the first three decimal places which is all that is necessary to answer the question.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
I have been working for a while on the question because I felt there is more to it than what meets the eye. Before I explain the method I used to solve the question let me explain what I understand the question is asking for. The question wants to determine the expected number of rolls it takes to produce a number that is less than any previous role. A logical question is What happens if I roll 1 in the first turn? I presume that in this case the game finishes. In fact, number 1 is a winner, if I roll a 1 I am done. On the contrary, number six is a loser. You can not win if you role a 6. The complication lies in the numbers in between. OK so here goes the calculation: Let us start from roll 1. If I roll a 1 I win. If I roll 2,3,4,5 and 6 I lose. So P(1)=1/6=0.167. Now suppose I did not roll a 1, this has a likelihood of 5/6. I go to role 2. In roll 2, if I have already rolled 6 then rolling 1,2,3,4 and 5 is a win. if I have already rolled 5 then rolling 1,2,3 and 4 is a win.if I have already rolled 4 then rolling 1,2 and 3 is a win. if I have already rolled 3 then rolling 1 and 2 is a win. and if I have already rolled a 2 the rolling 1 is the only winner. Computing the probability that I win in the second round I get. P(2)=5/12=0.417. Continuing the same way I get: P(3)=0.255 P(4)=0.108 P(5)=0.038 P(6)=0.012 P(7)=0.003 P(8)=0.001 P(9)=0.0002
Ok so Now I can neglect the remaining values as they are too small and will not affect the answer. The expected value for the number of rolls is given by:
E [ X ] = a l l x i ∑ x i × P i
This gives E(X) = 1 x 0.167 + 2 x 0.417 + 3 x 0.255 + ... = 2.488
So final answer is 2.488
Now I understand that this is not the solution according to the problem. But I do not understand the logic behind the solution presented by Mr. Andy Hayes. This is my take on the problem. What do you think
Thank you for your time
For more details Email me humam_sebai@hotmail.com
Log in to reply
I read it the opposite- each time you begin you need one roll to set the game and another roll to see if your roll is less. So if you roll a 6 then you win on your next roll with anything but a 6. If you roll a 1 then you never win on the second roll and then it depends on the next roll to set the game thus the iterative logic in most of the answers. I am not up on this enough to solve, but I think my basic understanding of the rules is correct.
Log in to reply
Yes Thanks a lot I get it now I modified my calculations and I got the right answer 2.985
You only stop if your current roll is smaller than any previous roll. Since, at the first roll, you have no previous rolls, it is impossible for your first roll to be less than any previous roll. Thus you cannot stop at the first roll. As Donal says, you will definitely not stop at the second roll if your first roll was 1 , either.
Them dice'll make you talk - Damon Runyon
I got it Now
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Stars and Bars
If X is the number of rolls made with an n -sided dice, then P [ X > N ] is the probability that the first N rolls come in ascending order. A standard stars-and-bars argument tells us that this probability is P [ X > N ] = ( N N + n − 1 ) × n − N and hence E [ X ] = N = 1 ∑ ∞ P [ X ≥ N ] = N = 0 ∑ ∞ P [ X > N ] = N = 0 ∑ ∞ ( N N + n − 1 ) n − N = ( 1 − n − 1 ) − n = ( n − 1 n ) n With n = 6 , this makes the answer ( 5 6 ) 6 = 2 . 9 8 5 9 8 4 . The limit as n → ∞ of the expected value is e .