[Math] Probability that there are at least two consecutive heads

probability

Please check my approach for this probability problem

Suppose I have a fair, two-sided coin. If I roll it $5$ times, what is the probability that there are at least two consecutive heads?

Please check my approach:
There are $2^5=32$ possible situations. Now, I want to find the probability that there are no consecutive heads, and subtract that from $1$.

Now, I can't have $4$ or $5$ heads, because there is a guarantee that there will be at least one set of consecutive heads.

For $3$ heads, there is only one possibility I can think of, $HTHTH$.

For $2$ heads, if my first head lands first, then my second head could land third, fourth, or fifth. If heads #1 lands second, them my second could land fourth or fifth, and if the first heads lands third, the second can land fifth, so we have $6$ possibilities.

For $1$ head, it can land anywhere, so there are $5$ possibilities.

Computing the probability, we get $6+5+1=12$ possibilities with NO consecutive heads, so the probability that we get no consecutive heads is $\frac{12}{32}=\frac38$, so the probability we DO get consecutive heads is $\boxed{5/8}$.

Am I doing this correctly? If so, is there a better way to do this? If not, what went wrong?

Best Answer

Good job. You almost got it all. You forgot the possibility of getting $0$ heads, the answer should be $1-\frac{13}{32}=\frac{19}{32}$.

Here's another approach.

Suppose we roll the coin $n$ times, what is the number of configuration such that there are no consecutive heads? let the number of such configuration be $f(n)$.

  • The configuration can start with a tail, then follow by $n-1$ tosses with no consecutive heads.

  • The configuration can also start with a head and then tail, then followed by $n-2$ tosses with no consecutive heads.

$$f(n)=f(n-1)+f(n-2)$$

Note that $f(1)=2$, $f(2)=3$.

Hence, we have a shifted Fibonacci sequence.

$$f(n)=\frac{(1+\sqrt5)^{n+2}-(1-\sqrt5)^{n+2}}{2^{n+2}\cdot \sqrt5}$$

The probability that you are looking for is

$$1-\frac{f(n)}{2^n}=1-\frac{(1+\sqrt5)^{n+2}-(1-\sqrt5)^{n+2}}{2^{2n+2}\cdot \sqrt5}$$

For your problem, we can quickly look up for the $7$-th Fibonacci number.

$$1,1,2,3,5,8,13.$$

Hence the answer should be $$1-\frac{13}{32}=\frac{19}{32}$$