[Math] Why is the expected number coin tosses to get $HTH$ is $10$

intuitionprobability

Can someone please explain why is the expected number of coin tosses to get the sequence of $HTH$ is $10$? What is the intuition and formulas behind this?

Best Answer

Denote the state before tossing $\emptyset$, you start in it. If your first toss is $H$, you proceed to the next state, otherwise stay in $\emptyset$. From state $1$ there's no way back to state $\emptyset$, but if you toss $H$ you stay in state 1 (since you need $HTH$). You should get something like

$\mathbf{P} = \begin{bmatrix}\frac{1}{2} & \frac{1}{2} & 0 & 0\\0 & \frac{1}{2} & \frac{1}{2} & 0 \\ \frac{1}{2} & 0 & 0 & \frac{1}{2} \\ 0 & 0 & 0 & 1\end{bmatrix}$

EDIT the equation for mean first hitting time until set $R$ from state $1$ is

$$ m_{1, R} = p_{1,2} m_{2, R} + (1-p_{1,2})m_{1,R} $$ in your case you need 3 equations with 3 unknowns.