We can consider two cases for the first flip: either it is a head with probability $p$, or it is a tail with probability $1-p$. If the first flip is a head, then we need to flip until we get a tail, which has an expected number of $\frac{1}{1-p}$ flips. If the
Show more…