Skip to main content
5 of 7
added 1 character in body
Iosif Pinelis
  • 127.8k
  • 8
  • 107
  • 229

Supoose $n\ge4$. For any natural $j$, let $I_j$ be the indicator of heads in the $j$th flip. Then the number of times 4 consecutive heads appear in $n$ flips is $$N_H=\sum_{j=1}^{n-3}\prod_{k=0}^3 I_{j+k}.$$ So, $$EN_H=\sum_{j=1}^{n-3}\prod_{k=0}^3 EI_{j+k} =\sum_{j=1}^{n-3}\prod_{k=0}^3\frac1{2j-1+2k}=\frac{4 n^3-18 n^2+23 n-15}{45 (2 n-5) (2 n-3) (2 n-1)}. $$ Similarly, the expected number of times 4 consecutive tails appear in $n$ flips is $$EN_T=\sum_{j=1}^{n-3}E\prod_{k=0}^3 (1-I_{j+k}) \\ =\sum_{j=1}^{n-3}\prod_{k=0}^3 (1-EI_{j+k}) =\sum_{j=1}^{n-3}\prod_{k=0}^3\Big(1-\frac1{2j-1+2k}\Big) =\frac{4 (n-3) \left(n \left(6 n^2+4 n-39\right)+23\right)}{3 (2 n-5) (2n-3) (2 n-1)}+2 H_{n-4}-4 H_{2 n-7}, $$ where $H_p$ is the $p$th harmonic number. The expected number of points you would get is $EN_H+EN_T$ for $n=100$, which is $$\approx89.0556\approx100,$$ which makes sense.

Iosif Pinelis
  • 127.8k
  • 8
  • 107
  • 229