A fair coin is being tossed until one gets exactly n heads in a row i.e. for n=5, we are seeking for the sequence "HHHHH". The function f(n) counts how many times, on average, you'll have to toss to accomplish the same task, that is, the expected number of tosses.
Calculate f(8).
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 n , j be the expected number of additional tosses needed to end up with a streak of n Heads in a row given that the current streak of Heads is of length j . Then X n , n = 0 and (conditioning on the outcome of the next toss): X n , j = 2 1 ( 1 + X n , j + 1 ) + 2 1 ( 1 + X n , 0 ) 0 ≤ j ≤ n − 1 so that 2 X n , j − X n , j + 1 2 j X n , j − 2 j + 1 X n , j + 1 X n , 0 − 2 j X n , j f ( n ) = X n , 0 = 2 + X n , 0 = 2 j + 1 2 + X n , 0 = k = 0 ∑ j − 1 2 k + 1 2 + X n , 0 = ( 2 + X n , 0 ) ( 1 − 2 − n ) = 2 ( 2 n − 1 ) which makes f ( 8 ) = 2 ( 2 8 − 1 ) = 5 1 0 .
Alternatively, if we consider the first n tosses, then there could be anything between 0 and n tails before we get the first head. Thus we deduce that (we are conditioning on the possibility of there being j − 1 Heads, followed by a Tail (for 1 ≤ j ≤ n ), or else there are n Heads, in the next few tosses): f ( n ) 2 − n f ( n ) f ( n ) = j = 1 ∑ n 2 j 1 ( j + f ( n ) ) + 2 n 1 × n = j = 1 ∑ n 2 j j + 2 n n + ( 1 − 2 − n ) f ( n ) = 2 − 2 1 − n = 2 ( 2 n − 1 ) (again).