0

A coin shows heads with probability $p$. Let $X_n$ be the number of flips require to obtain a run of $n$ consecutive heads. Show that $E(X_n)=\sum_{k=1}^{n}p^{-k}$.

For this problem, I think I need to use conditional on $X_{n-1}$, and I know that $$E(E(X_n\,\vert\,X_{n-1}))=E(X_n)$$ But I don't know how to use this equality to obtain the result.

Simple
  • 3,593

1 Answers1

1

I think I need to use conditional on $X_{nāˆ’1}$

It's rather a curious way. Let's try. To be clear, let's call $X_k$ the number of flips at which we got for the first time a run of $k$ consecutive heads.

Suppose we know that, for a particular realization $X_5 = 20$. What does this tell us about $X_6$? Well, there are two possibilities. Either we get another head (porb $p$) and then $X_6=21$, or either we get a tail (prob $1-p$), in which case we must start over and our new expectation for $X_6$ is the original one plus the wasted $21$ attempts.

In general, that is to say:

$$E[X_n \mid X_{n-1}]= p \, (X_{n-1}+1) + (1-p) (E[X_n]+X_{n-1}+1)$$

Taking expectations over $E_{n-1}$ and calling $M_n=E[X_n]$ we get

$$M_n= p (M_{n-1}+1) + (1-p) (M_n+M_{n-1}+1) $$

$$ p \, M_n = M_{n-1}+1$$

This is a recursive equation, with the initial condition $M_1=1/p$. It's easy to check that $M_n=E(X_n)=\sum_{k=1}^{n}p^{-k}$ is the solution.

leonbloy
  • 63,430
  • How to do this problem without condition on previous result? – Simple Nov 12 '16 at 03:48
  • See other answers here http://math.stackexchange.com/questions/364038/expected-number-of-coin-tosses-to-get-five-consecutive-heads – leonbloy Nov 12 '16 at 14:00