Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider a coin that comes up heads with probability $p$ and tails with probability $1-p$ We flip this coin (independently) and stop as soon as it comes up heads for the 5th time. Let X be the random variable whose value is the total number of times we flip the coin. What is the expected value E(X) of X?

I'm unsure on how to find the expected value of this.

Can we use the $E(X) = np$ rule for this type of question, if so then the answer would be $5p$.

Possible answers (one of the following): $$\frac{5}{p},5p,\frac{1}{p^5}, p^5$$

share|cite|improve this question
Are you familiar with the negative-binomial distribution? – user137481 Apr 18 '14 at 2:49
So I justed searched it up, what makes this NBD? Is expected value of NBD $\frac{r}{p}$ where $r=5$ and $p$ is my probability? – GivenPie Apr 18 '14 at 2:52
If $X\, is\,Negative-Binomial(5, p) \,then\, E(x)=5(1-p)/p$ – user137481 Apr 18 '14 at 2:54
@undergrad I don't think it is a negative binomial distribution. The possible answers are: $\frac{5}{p}, 5p, \frac{1}{p^5}, p^5$ – GivenPie Apr 18 '14 at 3:06
Well $X > 5$, but $5p < 5$. I think what you need is $Xp=5$ – user137794 Apr 18 '14 at 3:09
up vote 3 down vote accepted

The average amount of time you need to wait til the first heads is $\frac{1}{p}$ (this is the mean of a geometric distribution with parameter $p$ - the time it takes for the first head to appear when iid coins are flipped with heads probability $p$). After you get the first heads, you wait on average another $\frac{1}{p}$ for the second heads, since the geometric distribution si memoryless. So on so forth, and you get $\frac{5}{p}$. Alternatively, you can use the negative binomial distribution as suggested in the comments.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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