TITLE: Expected number of tosses to get 3 consecutive Heads
QUESTION [9 upvotes]: I have a fair coin. What is the expected number of tosses to get three Heads in a row? 
I have looked at similar past questions such as Expected Number of Coin Tosses to Get Five Consecutive Heads but I find the proof there is at the intuitive, not at the rigorous level there: the use of the "recursive" element is not justified. The Expectation $\mathbb E[X]$ is a number, not a random variable, as it is treated there. Please make this clear.

REPLY [15 votes]: Although the question has already been answered, I would like to offer a very similar solution but a different approach mindset to it.

It is a crude image but it essentially explains the answer above very beautifully.
At the beginning, we have no coins tossed so we have no consecutive heads. Next, we toss an $H$ or $T$ with probability $\frac{1}{2}$. Thus, we go the next state $2$ with probability $\frac{1}{2}$, similarly with $3$ and $4$.
Let $g(x)$ be the expected time until we reach state $4$, $HHH$, from state $x\in\{1,2,3,4\}$. Obviously $g(4)=0$ since we are already at state $4$!
\begin{align}
g(1)&=\frac{1}{2}(g(2)+g(1))+1\\
g(2)&=\frac{1}{2}(g(3)+g(1))+1\\
g(3)&=\frac{1}{2}(g(4)+g(1))+1\\
\end{align}
Since whenever we move from one state to another we take or "waste" one step. However, we only take a step in the correct direction with probability $\frac{1}{2}$. Otherwise, we have to go back to state $1$ and need to find $g(1)$.
Thus, by substitution (or recursion),
$$g(1)=1+\frac{1}{2}g(1)+\frac{1}{2}\left(\frac{1}{2}g(3)+\frac{1}{2}g(1)+1\right)=1+\frac{1}{2}g(1)+\frac{1}{4}g(1)+\frac{1}{2}+\frac{1}{4}\left(\frac{1}{2}g(1)+1\right)=1+\frac{1}{2}+\frac{1}{4}+g(1)\left(\frac{1}{2}+\frac{1}{4}+\frac{1}{8}\right)$$

$$g(1)=14$$