Coin flipping problem Suppose that you are flipping a coin endless times. what's the expected round where you would get the same side $3$ consecutive times? I'm guessing it would take $7$ flips to see either HHH or TTT sequence. Because the expected flip to see a HH or TT is $6$ flips and plus the initial flip it would $7$.
Am I correct?
 A: Another approach.  Let $t_k$ be the expected number of tosses needed to see $k$ identical flips in a row.  Clearly $t_1 = 1$; the first toss is always identical to itself.
We can create a recursion as follows.  In order to get $k+1$ identical tosses in a row, we must first get $k$ identical tosses, which takes time $t_k$.  On the next toss, with probability $\frac{1}{2}$, we achieve our goal of $k+1$ identical tosses; but also with probability $\frac{1}{2}$, we are back to the square one (we can use the toss that set us back as the first toss of the new attempt).  Thus
$$
t_{k+1} = t_k + \frac{1}{2} \times 1 + \frac{1}{2} \times t_{k+1}
$$
which can be simplified to obtain
$$
t_{k+1} = 2t_k+1
$$
This recurrence is easily solved with the boundary condition $t_1 = 1$ to yield
$$
t_k = 2^k-1
$$
and in particular, $t_3 = 2^3-1 = 7$.
A: Let $\psi(i, j)$ be the expected number of rounds to reach state $j$ from state $i$, where $i,j = \{0,1,2,3\}$.
$\psi(0,3) = 1+ \psi(1,3)$
$\psi(1,3) = 1+ \frac{1}{2}\psi(1,3)+\frac{1}{2}\psi(2,3)$
$\psi(2,3) = 1+\frac{1}{2}\psi(1,3)+\frac{1}{2}\psi(3,3)$
$\psi(3,3) = 0 $
Solve for $\psi(0,3)$. The answer is $7$.
A: Denote by $E_k$ $(0\leq k\leq 2)$ the expected number of additional throws when you have $k$ equal throws on the top of your stack. Then
$$E_0=1+E_1,\qquad  E_1=1+{1\over2} E_2+{1\over2} E_1,\qquad   E_2=1+{1\over2} 0+{1\over2} E_1\ ,$$
with the solution $E_0={\bf 7}$, $E_1=6$, $E_2=4$. That's it.
