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

A coin having probability $p$ of coming up heads is successively flipped until the $r^{th}$ head appears. Let $X$ be the number of flips required. Find the probability $P(X=n)$.

So this means I need to find the probability that $n$ flips are needed to get the $r^{th}$ head. I am not sure how to proceed. Any help/clarification please?

Thank you.

share|cite|improve this question

If $n$ flips are required to get $r$ heads, it means in $n-1$ flips you already have $r-1$ heads and the $n^{th}$ flip is a head. Assuming successive flips are independent,

$P(X=n)=P(r-1 \text{ heads in } n-1 \text{ flips})*p$


share|cite|improve this answer

I'm quite sure this question involves some sort of distribution. You might want to search about the Negative Binomial distribution. Given the probability of a success $p$, calculate the number of times, $n$, you will need to achieve $r$ successes.

I will shamelessly copy the equation from Shyam

$$P(X=n)=\binom{n-1}{r-1}p^{r-1}{(1-p)}^{n-r}\times p$$

There are 3 parts to this equation (RHS), namely:

  • Basically, the $\binom{n-1}{r-1}$ means there are these number of ways where you can select $r-1$ successes, out of $n-1$ tries.
  • The next part, $p^{r-1}{(1-p)}^{n-r}$ means, assuming the event of success is independent, once again, $r-1$ successes and $n-r$ failures. Consider that $(n-r) + (r-1) = (n-1)$, which is the total number of tries so far.
  • Multiply that with $p$, which is the probability of the last success, and you get your answer.
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.