4
$\begingroup$

An unfair coin has probability $\frac{2}{3}$ of landing heads. The coin is flipped repeatedly until its sequence of flips includes at least one heads and at least one tails. What is the expected number of flips untils this happens?

My approach:

Let, $N$ be the number of tosses until we get at least one heads and at least one tails.

$E[N]= E[N | $ we tosses a heads first $ ] + E[N | $ we tosses a tail first $]$

$ (N | $ we tosses a heads first$]) $ follows $ Geom(\frac{1}{3}) $

$ (N | $ we tosses a tails first$]) $ follows $ Geom(\frac{2}{3}) $

$E[N] = \frac{2}{3} \times (1+3) + \frac{1}{3} \times (1+\frac{3}{2}) $

$$E[N] = \frac{21}{6} = 3.5 $$

Is my approach correct?

$\endgroup$
3
  • 2
    $\begingroup$ Please see How many flips to get at least one heads and at least one tails. $\endgroup$ Commented Oct 11, 2024 at 9:34
  • $\begingroup$ Oh, yes, I forgot to add the first flip. Does it seem right now? Thank you. $\endgroup$ Commented Oct 11, 2024 at 9:49
  • 1
    $\begingroup$ Indeed, it does. $\endgroup$ Commented Oct 11, 2024 at 10:39

1 Answer 1

2
$\begingroup$

The count equals one (the first toss) plus the count until the opposing result is obtained.

Let $H$ be the event that the first toss shows heads, and $T$ the complementary event that the first toss shows tails.

Then by the Law of Total Expectation, and since $N-1\mid H\sim\mathcal{Geo}_1(1/3)$ and $N-1\mid T\sim\mathcal{Geo}_1(2/3)$

$$\begin{align}\mathsf E(N) &= \mathsf P(H)\,\mathsf E(N\mid H)+\mathsf P(T)\,\mathsf E(N\mid T)\\&=1+(\dfrac 23\cdot3+\dfrac 13\cdot\dfrac32)\\&=\dfrac 72\end{align}$$


As you obtained.

But notice, although you did include it in your later calculations, the first line must include the probabilities for the first toss's outcomes.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.