Expectation and Variance of the sequence $HHH$ in $n$ tosses

1k Views Asked by At

Toss a fair coin $n \ge 5$ times, and let $X$ be the number of occurrences of the pattern $HHH$ in the sequence of tosses. For example, if $n = 9$ and the outcome is $\omega = HHTHHHHTH$ then $X(\omega) = 2$. Compute E[$X$] and Var ($X$).

My idea so far is to start with $n=5$, where there are three possible outcomes that give us at least three consecutive heads, namely $HHHTT,THHHT,TTHHH,HHHHT,THHHH,HHHHH$, in the first three outcomes we get $X(\omega)=1$, in the third and fourth outcomes we get $X(\omega)=2$, and for the final outcome we get $X(\omega)=3$.

When we move on to $n=6$ and assess all outcomes we get $4$ occurrences of $X(\omega)=1$, $3$ occurrences of $X(\omega)=2$, $2$ occurrences of $X(\omega)=3$, and $1$ occurrence of $X(\omega)=4$.

I don't know exactly what to do with this information or if I'm going in the right direction, but any help is appreciated.

1

There are 1 best solutions below

4
On BEST ANSWER

Indicator random variables are your friend here. There are $n-2$ windows of three tosses in the sequence, and each window has a $\frac18$ chance to come up $HHH$ (i.e. we consider each window as a random variable, and these add to make $X$). Therefore the expected value of $X$ is $\frac{n-2}8$.

For the variance of $X$ we sum up the following:

  • Variance of each window: $n-2$ times $\frac18×\frac78$, or $\frac7{64}(n-2)$
  • Covariance of windows one toss apart: twice $n-3$ times $\frac1{16}-\frac1{8^2}$, or $\frac6{64}(n-3)$
  • Covariance of windows two tosses apart: twice $n-4$ times $\frac1{32}-\frac1{8^2}$, or $\frac2{64}(n-4)$

Thus the variance of $X$ is $$\frac1{64}(7(n-2)+6(n-3)+2(n-4))=\frac{15n-40}{64}$$