0
$\begingroup$

You are given a coin, which when tossed lands on H (heads) with probability $p$ and T (tails) with probability $1-p$. What is the expected number of flips that you must do before you get $L$ consecutive H?

I am aware how to solve the problem when $L$ is fixed. Let $X$ denote the number of needed flips. Then the answer is $E[X] = \frac{1 - p^L}{p^L(1 - p)}$ (an example derivation is shown here).

What about when $L$ is a random variable with a known distribution? I tried applying the same method as when $L$ is fixed but I can't wrap my head around it because in that case the probability for scoring $L$ consecutive heads is namely $p^L$ which is also a random variable. Do I need simply to work with $E[L]$ when calculating $E[X]$? And if yes, then why?

$\endgroup$
1
$\begingroup$

Assuming the $L$ takes the values $1,2,3,\dots$ with probabilities $r_1,r_2, r_3,\dots$ and that $L$ and the coin tossing are independent, we have $$ \Bbb E X = \sum_{n\ge 1} \Bbb E[X|L=n]\cdot\Bbb P(L=n) = \sum_{n\ge 1} \frac{1-p^n}{p^n(1-p)}\cdot r_n \ . $$

$\endgroup$
  • $\begingroup$ Ah, of course. Now I feel silly. Thank you. $\endgroup$ – 0x450 Jun 9 '18 at 18:55
1
$\begingroup$

You can apply the general rule:$$\mathbb EX=\mathbb E[\mathbb E[X\mid L]]$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.