Suppose I am flipping a fair coin. What's the expected number of coin flips to get THTHTT?
I know how to do this using a Markov chain approach. However, I end up with a system of six linear equations. I can work through the algebra but it becomes unwieldy. I wonder if there is an easier way, such as through a Martingale approach?
Can I get a hint?
Below i will use $0,1$ instead of $H,T$. Consider the space $\Omega$ of all $0,1$-words, and the $\sigma$-algebra generated by all events $A(w)$, where $A(w)$ is the set of words starting with $w$. We give $A(w)$ the probability $(1/2)$ to the power length of $w$.
Our pattern of interest is: $$ \bbox[yellow]{\qquad101011\qquad} $$ On $\Omega$ we have the a lot of previsible gamblers. Let $w_1w_2w_3\dots$ be a word in $\Omega$.
The gambler $n$ bets on the "letters" $w_nw_{n+1}w_{n+2}w_{n+3}w_{n+4}w_{n+5}\dots$. If the casino is still working. (The gambler wants of course more / longer, but the rules of the game are not making this possible.)
The casino decides to stop when $101011$ occurs for the first time. This is a stopping time $\tau$ on $\Omega$.
Each gambler comes with one € and sets it over and over again, as long as still winning, on results corresponding to our pattern. In its first chance $1$, then $0$, then $1$, then $0$, then $1$, then $1$. (And then something that does not matter any more.)
Each match is rewarded by the double of the last bet amount. This is a fair game. So let us compute the wins of the casino, and of the many gamblers, restricted to $A(w)=A(w'101011)$ for some word $w=w'101011$ that does not contain the pattern $101011$ at an earlier place:
Casino wins $\Bbb E[\tau|A(w)]$, the length of $w$ in €.
All the many gamblers, except for the last six, lose their money, since the pattern was never before.
Gambler $-6$ wins $2^6$ €, here is the superposition:
Gambler $-5$ wins $0$ €, here is the superposition:
Gambler $-4$ wins $0$ €, here is the superposition:
Gambler $-3$ wins $0$ €, here is the superposition:
Gambler $-2$ wins $0$ €, here is the superposition:
Gambler $-1$ wins $2$ €, here is the superposition:
Putting all money in a balance, we have, first conditioned to $A(w)$, then after aggregation on all $\Omega$ (since the pattern comes with probability one): $$ \bbox[yellow]{\qquad E[\tau]=64+2=66\ .\qquad} $$
Monte-Carlo check:
And we get: