I am feeling sleepy but can't sleep. So I decide to roll a dice as many times as it takes until I get a 6 immediately after a 5.
Assuming each throw takes me one second and I will fall asleep as soon as I get a 6 immediately after a 5, what is the expected time (in seconds) in which I will fall asleep?
For example, if the results of the dice rolls are , then I must stop at roll 4 and fall asleep immediately, which implies that the time taken would be 4 seconds.
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.
Let X and Y be two random variables defined as follows:
X : Number of rolls until 6 appears immediately after a 5
Y : Number of rolls until either 6 appears in the first roll or 6 appears immediately after a 5
Lets relate the expected values of random variable
X
andY
before and after the most recent throw.E [ X ] = 6 5 E [ X + 1 ] + 6 1 E [ Y + 1 ]
E [ Y ] = 6 1 + 6 4 E [ X + 1 ] + 6 1 E [ Y + 1 ]
Solving these two equations yield E [ X ] = 3 6
Explanation for above two equations
Let A be the event that the most recent roll was a 5 .
We know that:
E [ X ] = E [ X ∣ A ′ ] × P [ A ′ ] + E [ X ∣ A ] × P [ A ]
E [ X ] = 6 5 E [ X ∣ A ′ ] + 6 1 × E [ X ∣ A ]
Now, here's the crucial part,
E [ X ∣ A ′ ] = E [ X + 1 ]
The above is true because given the most recent throw was determined to be not a 5 , the expected value is same as that of X + 1 because of the memorylessness property.
Similarly E [ X ∣ A ] = E [ Y + 1 ] because given the most recent roll is determined to be 5 , the expected value is same as that of Y + 1 .
Similarly the second equation can be thought of.