You flip a fair coin several times.
Find the expected value for the number of flips you'll need to make in order to see the pattern TXT, where T is tails, and X is either heads or tails.
If the expectation value can be expressed as b a , where a and b are coprime positive integers, find a + b .
Clarification
: You are looking for the pattern TTT or THT. That is, you will keep flipping until you see one of these two patterns, and then count the number of flips you made.
Other Expected Value Quizzes
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.
@Geoff Pilling Could you please explain how you got the first 4 linear equations.
Log in to reply
Yeah, I've added a small explanation to the solution. Does it make sense? Or should I add a bit more?
why cant we do like this? :( :( where am I wrong?
if expected value of coin flip for T X T is E
then E = 2 E + 1 + 4 E + 3 + 4 3 ........which gives us E = 8 :( :(
Log in to reply
How did you derive this equation?
Log in to reply
ohh wait!!
first we get T X T in 3 flips......then it is 4 1 ∗ 3
otherwise if we get T H H in first 3 flips......then it will be 8 1 ∗ ( E + 3 ) .....
if we get T T H in first 3 flips......it's probability is 8 1 ...on next flip we may get T T H T or T T H H .......then it should be 8 1 ∗ ( 2 1 ∗ ( 4 + E ) + 2 1 ∗ 4 )
and the other only case is we get H on the first flip......then it is 2 1 ∗ ( E + 1 )
so we can write E = 2 E + 1 + 4 3 + 8 1 ∗ ( E + 3 ) + 8 1 ∗ ( 2 1 ∗ ( 4 + E ) + 2 1 ∗ 4 )
this gives us E = 5 3 4 ......ohh ok!! - - - - i should have noticed....how dumb I am :( :( :(
I tried like this::
first we get T X T in 3 flips......then it is 4 1 ∗ 3
otherwise if we get T X H in first 3 flips......then it will be 4 1 ∗ ( E + 3 ) .....
and the other only case is we get H on the first flip......then it is 2 1 ∗ ( E + 1 )
so we can write E = 2 E + 1 + 4 E + 3 + 4 3
Let the expected value for the required number of flips be E.
There are three cases possible:
1) TXT, If we get this pattern at any step, we stop there.
2) TXH, If we get this pattern then we start flipping again to get the pattern in (1). Flipping after getting H is equivalent to flipping at beginning.
3) H, If we get this pattern then we start flipping again to get the pattern in (1). Flipping after getting H is equivalent to flipping at beginning.
Expected value = Value of the event * Probability of that event
Value of the event = No. of flips required in the event
Exp[1] = 3 * (1/2 * 1 * 1/2)
Exp[2] = (3+E) * (1/2 * 1 * 1/2)
Exp[3] = (1+E) * (1/2)
Thus E = (E+1)/2 + (E+3)/4 + 3/8 => E = 8
What is wrong here? I think answer should be (8+1 =) 9.
This way of reasoning is entirely right. But you guys got the TTH case wrong. This case does not give E+3. From TTH, we get either TTHT (4) or TTHH (E+4), with 1/16 of probability for each. If we substitute this in, we get the same answer for both methods.
@Geoff Pilling ur solution is not correct. When we calculate ur solution, we get 6 as a expected value, but the answer is 9
sorry meant 39
A Monte Carlo solution in Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
We are around 6 . 8 = 5 3 4
Ah, very nice! :)
Problem Loading...
Note Loading...
Set Loading...
The expectation value is given by this set of linear equations:
Where,
How are these equations derived? Well for the first one, if we are in state E , we use up one flip (the " 1 "), and we have a 2 1 probability of ending up in state E 1 (if we flip tails) and 2 1 probability of ending up in sate E again (if we flip heads). The rest of the equations are derived similarly.
Solving for E you get, E = 3 4 / 5 . 3 4 + 5 = 3 9