Expected number of tail before $T_M$.

markov chainsmarkov-processprobabilityprobability theorystochastic-processes

We flip a coin with head probability $p$. Before the game starts, we have 1 dollars. Each time we flip the coin, if it's head, then our fortune increases by 1; if it's tail, then our fortune returns to 1. Let $S_i$ be our fortune at $i$-th trial (so $S_0 = 1$).

Let $T_M = \min\left\{i: S_i = M \right\}$. Find the expected value of tails before $T_M$, $\mathbb{E}\left[ \sum_{i=1}^{T_M} 1_{Tail}\right]$

I tried to use Wald's identity since $T_M$ is a stopping time, but I still need to find $\mathbb{E}\left[T_M\right]$. I'm not sure how to find it. My vague thought is to use geometric random variable, with the event "getting $M-1$ heads in row" as success (having probability $p^{M-1}$), but I'm not sure how to proceed.

Best Answer

It requires $M-1$ consecutive heads to stop. The expected number of steps until $M-1$ consecutive heads is given by $$ \mathsf{E}T_M=\frac{p^{-M+1}-1}{1-p}. $$

Then the expected number of tails is $(1-p)\mathsf{E}T_M=p^{-M+1}-1$.