Probability of getting consecutive heads in $100$ coin tosses if$ P(H) = 0.04$ and $P(T) = 0.96$

If there is an uneven coin where heads show up $4\text{%}$ of the time and tails show up $96\text{%}$ of the time, what is the probability of seeing consecutive heads in $100$ coin tosses?


Solution 1:

Long story short, the probability of getting at least two consecutive heads is $14.1620049600103\%$.

To find this value, let define the variable $X$ which is the beginning of the first two consecutive heads. E.g. if $X=6$, there are no two consecutive heads before the sixth throw, the fifth throw need to be tail, the sixth and seventh throw are heads. The rest doesn't matter.

The first three cases are straightforward. $X=1$, getting heads on the first two throw. $$P(X=1)=(0.04)(0.04)$$ $X=2$, we need $THH$ $$P(X=2)=(0.96)(0.04)(0.04)$$ $X=3$, we have $?THH$ ( first throw doesn't matter). $$P(X=3)=(1)(0.96)(0.04)(0.04)$$ Starting from $X=4$, we need to make sure there are no consecutive heads before. $$P(X=4)=\left(1-\sum_{k=1}^1P(X=k)\right)(0.96)(0.04)(0.04)$$ Generaly, $$P(X=n)=\left(1-\sum_{k=1}^{n-3}P(X=k)\right)(0.96)(0.04)(0.04)$$ We want to know the sum up to $X=99$. Using a spread sheet, we have $$\sum_{n=1}^{99}P(X=n)=14.1620049600103\%$$ Thanks to @Henry for a closed form of this number $$1-\left(\frac12-\frac{13\sqrt{42}}{168}\right)\left(\frac{12-\sqrt{168}}{25}\right)^{100}-\left(\frac12+\frac{13\sqrt{42}}{168}\right)\left(\frac{12+\sqrt{168}}{25}\right)^{100}$$