Negative binomial distribution calculator

Answers questions like the chance your second six comes on roll 10, or that a salesperson closes 3 deals within 10 calls.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter successes needed r, success probability p and trial number k.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

P(X = k) = C(k - 1, r - 1) × p^r × (1 - p)^(k - r), where X is the trial on which the r-th success happens. P(X ≤ k) sums these terms from r to k. Mean = r ÷ p, standard deviation = √(r × (1 - p)) ÷ p.

Example

Inputs: Successes needed r = 3, Success probability p = 0.5, Trial number k = 5. Result: P(r-th success on trial k): 0.1875; P(r successes within k trials): 0.5; P(more than k trials needed): 0.5.

Limits and caveats

  • Counts trials up to and including the r-th success; some textbooks count only the failures, which shifts the formula.
  • Assumes independent trials with the same success chance each time.

Questions about this tool

How is it different from the binomial distribution?

The binomial fixes the number of trials and counts successes. Here the number of successes is fixed and you count the trials needed to reach it.

What is the chance the third head comes on toss 5?

C(4, 2) × 0.5^5 = 6 ÷ 32 = 0.1875, or 18.75%.

How does it relate to the geometric distribution?

The geometric distribution is the special case r = 1, waiting for the first success only.