Expected number of tosses until getting consecutive heads or tails

1k Views Asked by At

I am faced with the following question (which might be quite classical):

Suppose that we have a fair coin and we toss it until we have two consecutive heads (H) or tails (T). What is the expected number of tosses until the game stops?

Let $X$ denote the required random variable and let $AB$ denote events $A$ followed by $B$, where $A, B \in \{ H, T\}$. Then by the standard technique of conditional expectation,

\begin{eqnarray} \mathbb{E} [X] & = & \mathbb{E} [X| TT] \mathbb{P}(TT) + \mathbb{E} [X| HH] \mathbb{P}(HH) \\ && + \mathbb{E} [X| TH] \mathbb{P}(TH) + \mathbb{E} [X| HT] \mathbb{P}(HT) \\ & = & 2 \big( \frac{1}{4} \big) + 2 \big( \frac{1}{4} \big) + \big( 2+ \mathbb{E} [X] \big) \big( \frac{1}{4} \big) + \big( 2+ \mathbb{E} [X] \big) \big( \frac{1}{4} \big) \\ & = & 2+ \frac{1}{2} \mathbb{E} [X], \end{eqnarray} which gives $$ \mathbb{E} [X] = 4.$$

However, the answer should be $3$. Is there a problem with this approach?

4

There are 4 best solutions below

0
On BEST ANSWER

$E(X)=\sum_{r=2}^\infty r\frac{2}{2^r}=\sum_{r=2}^\infty r\frac{1}{2^{r-1}}$ which is an AGP

Let $S=\sum_{r=2}^\infty r\frac{1}{2^{r-1}}$

$S-\frac{S}{2}=1+\sum_{r=2}^\infty \frac{1}{2^{r}} \Rightarrow S=3$

1
On

The computation for $E[X|TH]$ and $E[X|HT]$ is wrong. It should be: $$\ E[X|TH]=2+1(P(H))+(E[X|HT]-1)P(T)\\ E[X|HT]=2+1(P(T))+(E[X|TH]-1)P(H)\\ \implies E[X|TH] = E[X|HT]=4 $$ Basically, the game gets over if you get THH or HTT. You need not wait till THHH or THTT.

Hint: To get $E[X|TH]$ condition it on the third toss and use $E[X|THT]=1+E[X|HT]$

0
On

Let $x$ be the expected number of coin tosses until you get two successive heads. Then we have $x = \frac{1}{2}(x+1) + \frac{1}{4}(x+2) + \frac{1}{4}(2) $. Solving this, we get $x=6$. By symmetry, the expected number of coin tosses until you get two successive tails is also 6. Therefore, the expected number of coin tosses until you get either HH or TT is 3.

0
On

If $E$ denotes the searched for expected number, you have

$$E = \frac 12 (1 + \frac 12\cdot 1 + \frac 12\cdot E ) +\frac 12 (1 + \frac 12\cdot 1+ \frac 12\cdot E )$$

Hence,

$$E=3$$