Say you flip a fair coin until the number of heads is either exactly 3 more then the number of tails or the number of tails is 3 more then heads. The 3 heads or tails do not have to be consecutive. What is expected number of flips ?
My analysis is as follows:
The following sequences are relevant:
HHH,TTT,HT,TH,HHTT,TTHH. I have ended each sequence because either game is complete or reset to start.
The expected length E is then calculated as follows: E=(1/4)(3)+ (2/4)(2+E)+(1/8)*(4+E) The first term is for HHH,TTT; 1/4 is the sum of the 2 probabilities and 3 is the number of flips of each. The 2nd term is for HT,TH; 2/4 is the sum of the 2 probabilities and each has 2 flips. The 3rd term is for HHTT and TTHH. Solving E= 6. Is this solution correct. ?
Also would like to know expected length of game if game ends when only the number of heads is 3 more then the number of tails.