Geometric distribution with parameter $p$ is the number of tosses of biased coint to get first head. The distributions is given by $P(X=k) = (1-p)^{k-1}p$. The expected number of tosses to get first head is $\frac{1}{p}$. Now, the question is to find the expected number of tosses to get the first HH pattern.
This comment has been removed by the author.
ReplyDeleteThere are two ways to approach this. the first one is based on explicitly writing down the expectation in form of an infinite series.
ReplyDelete$E = \sum_{n=1}\frac{n}{2^n}F_n$ where $F_1 = 0, F_2 =1, F_3=1, \ldots$ represents the Fibonacci series. This evaluates to 6.
Second approach is based on conditioning on the first toss.
ReplyDelete$E[n] = \frac{1}{2} E[n|X_1=H]+ \frac{1}{2}E[n|X_1=T]$
$E[n|X_1=H] = 2*P(X_2=H|X_1=H) + P(X_2=T|X_1=H)*E[n|X_1=H,X_2=T]$
$E[n|X_1=H] = 2*\frac{1}{2} + \frac{1}{2}(2+E[n])$
Similarly, $E[n|X_1=T] = 1+E[n]$
This recursive formulation gives $E[n] = 6$