0
$\begingroup$

In an infinite sequence of flipping a fair coin - $0.5$ probability to get heads/tails. (every flip is independent from the others).
What is the expected value of number of flips until we get Heads then Tails?

My Attempt:
I tried to think about the event HT as my R.V success. So let $X$ be the number of flips until we get HT.
The probability to get HT in a row is $\frac{1}{4}$, as we need the coin to land on H and then immediately on T.
But I thought to myself that a geometric RV doesn't really count those two as two flips, so I thought that for example:
TTTHHHT -> My random variable $X$ would be $6$.
So I set $Y=X+1$ and my answer was $E(X+1)=4+1=5$.

But turns out the real answer is $4$. Why my method is wrong? where does my logic/understanding fall?
Is it that $X$ is just the answer for this problem? but I can't see how that's right, or maybe I have issues in my geometric random variable understanding.
Would appreciate any help, Thanks in advance!

$\endgroup$
9
  • 1
    $\begingroup$ I did not understand how you counted $5$ $\endgroup$
    – Math Lover
    Commented Oct 2, 2021 at 18:39
  • $\begingroup$ "real answer" from where? $\endgroup$ Commented Oct 2, 2021 at 18:43
  • $\begingroup$ @herbsteinberg The writer of the question, the final answer provided with it.. $\endgroup$
    – Pwaol
    Commented Oct 2, 2021 at 18:52
  • 1
    $\begingroup$ OK I see now but the random variable will count $HT$ as $2$. $\endgroup$
    – Math Lover
    Commented Oct 2, 2021 at 19:00
  • 1
    $\begingroup$ But $E(X)$ for two heads in a row is $6$ $\endgroup$
    – Math Lover
    Commented Oct 2, 2021 at 19:18

2 Answers 2

1
$\begingroup$

Let $\xi_i$ be the result of the i-th coin toss, and let $X = \min_{n} \{n >0: \xi_n = T, \xi_{n-1}-H\}$ You can use the law of total probability, then you have $$\mathbb E(X) = \mathbb E(X|\xi_1=H) \mathbb P(\xi_1=H) + \mathbb E(X|\xi_1=T) \mathbb P(\xi_1=T) $$ We can calculate the conditional expectations. $$X|\xi_1=H \sim 1+Geo(1/2) \implies \mathbb E(X|\xi_1=H) = 1+2=3$$ $$E(X|\xi_1=T) = 1 + E(X)$$ If we substitute the results in the above equation, we get: $$\mathbb E(X) = 3 \frac 12 + \mathbb (E(X)+1) \frac 12 $$ $$\mathbb E(X) = 4$$

$\endgroup$
1
$\begingroup$

Here is how I would do it. Say $X$ is the event of getting $H, T$ in a row. Based on the first flip, we have two cases -

$i$) The first flip is $H$ - Then we are seeking the next flip to be a $T$. If we get $T$, we are done but if we get $H$, we are again looking for a $T$ and so on.

$ii$) The first flip is $T$ - We spent a flip and we are again back to where we started, that is seeking $H, T$.

So, $E(X) = 1 + \frac{1}{2} E(X) + \frac{1}{2} E(T)$

Now we know $E(T) = 2$

So, $E(X) = 4$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .