An unbiased coin is tossed repeatedly until the outcome of two successive tosses is the same. Assuming that the trials are independent, the expected number of tosses is
- $3$
- $4$
- $5$
- $6$
My attempt :
I used a formula
The expected number of coin flips for getting $n$ consecutive heads is $(2^{n+1} - 2)$.
Similarly,
The expected number of coin flips for getting $n$ consecutive tails is $(2^{n+1} - 2)$.
That gives two ways to satisfy the criterion to stop, so stopping will be sooner, not later.
So,
The expected number of coin flips for getting $n$ consecutive same tosses is $\frac{(2^{n+1} - 2)}{2}$.
Hence, answer is $3$.
Can you explain in formal way please?
A simple recursion: Let $E$ be the answer you want and let $E_1$ be the expected number assuming you have tossed at least once (but have not yet won). then $$E=E_1+1$$
as tossing the coin once gets you to the state governed by $E_1$. But then tossing again either ends the game (if you get a match) or leaves you with expectation $E_1$ again. Thus $$E_1=\frac 12 1 \;+\; \frac 12(E_1+1)$$
this is easily solved to get $E_1=2$, whence $E=3$.