What is the probability of finding the sequence HTHT in $n$ flips of a coin? By brute force I get
- $n=4: \frac{1}{2^4}$
- $n=5: \frac{2(2)}{2^5}$
- $n=6: \frac{2^2(3)-1}{2^6}$
- $n=7: \frac{2^3(4)-2}{2^7}$
- $n=8: \frac{2^4(5)-6}{2^8}$
I hoped to extract a pattern but counting gets messy.
EDIT: My original counts for $n=7$ and $n=8$ are, as noted in the comments, incorrect. Recounting I get \begin{align} \frac{2^3(4)-4}{2^7}\ \text{for}\ n=7\ \text{and}\ \frac{2^4(5)-12}{2^8}\ \text{for}\ n=8 \end{align} which agrees with the comment below.