When flipping a coin, why is the expected time till 3 Tails in a row different from Tail-Head-Tail? From the answer to this question (Expected Number of Coin Tosses to Get Five Consecutive Heads) it is clear that the expected number of flips of a fair coin till we see three tails in a row is 14. I wrote a computer simulation that again confirmed this, however when I altered the simulation to look for the expected number of flips until the pattern T-H-T occurred (instead of T-T-T), the expectation dropped to 10. Why is this? I'd prefer an answer that avoids Markov chains if at all possible.
 A: Let $L$ be the set of strings over $\Sigma=\{H,T\}$ which contain $THT$ as a substring. Then $L$ is a regular language, described by the regular expression $R = (H,T)^* THT (H,T)^*$ or by the deterministic finite automaton with states $S=\{\varepsilon, T, TH, T\}$ and transition function $\delta:S\times\Sigma\to S$ defined by
\begin{array}{l|l|l}
\delta(s,a) & H & T\\\hline
\varepsilon &\varepsilon  & T\\
T &TH &T\\
TH & \varepsilon & THT\\
THT & THT & THT
\end{array}
Suppose at each time $n$ we flip a coin and feed the result to the machine. Let $\tau_s$ be the expected number of flips until reaching state $THT$, given that the machine is in state $s$. Then
\begin{align}
\tau_\varepsilon &= 1 + \frac12\tau_\varepsilon + \frac12\tau_T\\
\tau_T &= 1 + \frac12\tau_{TH}+\frac12\tau_T\\
\tau_{TH} &= 1 + \frac12\tau_\varepsilon.
\end{align}
Solving these equations yields $\tau_\varepsilon=10, \tau_T = 8, \tau_{TH} = 6$, so the expected number of flips until $THT$, starting from the beginning, is $10$.
