Variance of a discrete random variable. variance of the number of consecutive pairs of head

58 Views Asked by At

Find the variance of the number of consecutive pairs of heads for n coin tosses. Problems arise when the intersection of pairs begins.

1

There are 1 best solutions below

0
On BEST ANSWER

I’ll assume $n\gt1$. Let $p$ denote the probability of the coin showing heads, and let $I_j$ be the indicator variable for the $j$-th toss being heads. Then $I_jI_{j+1}$ indicates a consecutive pair of heads in the $j$-th and $(j+1)$-th tosses, so the number of these pairs is

$$ N=\sum_{j=1}^{n-1}I_jI_{j+1}\;, $$

and its variance is

\begin{eqnarray} \operatorname{Var}N &=& E[N^2]-E[N]^2 \\ &=& E\left[\left(\sum_{j=1}^{n-1}I_jI_{j+1}\right)^2\right]-E\left[\sum_{j=1}^{n-1}I_jI_{j+1}\right]^2 \\ &=& (n-1)E[I_1I_2]+2(n-2)E[I_1I_2I_3]+((n-1)^2-(n-1)-2(n-2))E[I_1I_2I_3I_4]\\&&-((n-1)E[I_1I_2])^2 \\ &=& (n-1)p^2+2(n-2)p^3-(n-1+2(n-2))p^4 \\ &=& p^2(n-1+2(n-2)p-(3n-5)p^2)\;. \end{eqnarray}

For a fair coin with $p=\frac12$, this is $\frac{5n-7}{16}$. The variance is of course $0$ for $p\in\{0,1\}$. For large $n$ the variance goes as $p^2(1+2p-3p^2)n$, and this is maximal for $p=\frac{1+\sqrt{\frac{11}3}}4\approx0.729$, where it is $\frac{69+11\sqrt{33}}{288}n\approx0.459n$.