Flipping a biased coin with probability of heads coming up, what's the expected number of flips until two of the most recent three flips are heads?
If the result can be expressed as , where and are coprime positive integers, give your answer as .
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.
Two initial heads end the process in two flips with chance 1 in 10,000. In general one can overview the problem with the probability tree above. Filled disks and circles represent heads and tails respectively in the last two flips. Note two distinct non-stopping states (START and x ) which can be captured with a system of equations. Expected number of flips:
E [ N ] = p 2 ⋅ 2 + p q ⋅ ( 2 + x ) + q ⋅ ( 1 + E [ N ] )
x = p + q ⋅ ( 1 + E [ N ] )
Probability of heads is p , and of tails is q = 1 − p . Plug x into the first equation to get:
E [ N ] = p 2 ( 2 − p ) 1 + 2 p − p 2 = 1 9 9 1 0 1 9 9 0 0
With p = 0 . 0 1 . This makes the answer 1 0 2 0 0 9 9 .