Negative Binomial Distribution Calculator

Use our negative binomial distribution calculator to compute the probability of needing n trials to get r successes (with success probability p). Includes what the negative binomial distribution is, when to use it, the negative binomial distribution formula, and a worked example.

n (number of events)
Whole number (n ≥ 1). Must satisfy n ≥ r.
r (number of successes)
Whole number (r ≥ 1). Must satisfy r ≤ n.
Probability of one success (p)
Must be between 0 and 1 (exclusive).
Results
Probability of Y = n
P(Y=n)=C(n−1,r−1)·p^r·(1−p)^(n−r).
Combinations (n−1, r−1)
Computed as C(n−1,r−1).
P(Y=n)=C(n−1,r−1)·p^r·(1−p)^(n−r)
Did we solve your problem today?

What Is the Negative Binomial Distribution?

The negative binomial distribution models the number of trials needed to achieve a fixed number of successes when each trial is independent and has the same probability of success (p).

A common setup is: “What is the probability that the r-th success happens on the n-th trial?” This calculator follows that exact definition.

People often use the negative binomial distribution when they care about “how many attempts until we get r successes,” rather than “how many successes in a fixed number of attempts” (which is the regular binomial distribution).

Negative Binomial Distribution Formula

If Y is the trial on which the r-th success occurs, then Y takes values n = r, r+1, r+2, ... and the probability is given by the negative binomial PMF below.

PMF (r-th success occurs on trial n) =
P(Y = n) = C(n-1, r-1) · p^r · (1-p)^(n-r)

This is the most common “negative binomial distribution formula” used in probability problems.

Combinations term used in the PMF =
C(n-1, r-1) = (n-1)! / ((r-1)! · (n-r)!)

Counts ways to arrange the first n-1 trials so there are exactly r-1 successes before the final (r-th) success on trial n.

Negative binomial distribution example
If r = 3, n = 8, p = 0.4: P(Y=8) = C(7,2)·0.4^3·0.6^5

Interpretation: the 3rd success occurs exactly on the 8th trial.

Quick validity checks
n must be ≥ r, and 0 < p < 1

If n < r, getting r successes by trial n is impossible, so P(Y=n)=0.

Definitions

These are the key terms used in negative binomial distribution problems.

Trial
A single attempt/experiment with two outcomes: success or failure.
p (probability of success)
The probability a single trial is a success, where 0 < p < 1.
r (number of successes)
The target count of successes you want to reach.
n (trial of the r-th success)
The trial number on which the r-th success occurs (must satisfy n ≥ r).
C(n-1, r-1)
The combinations count used in the PMF; it counts ways to place r-1 successes in the first n-1 trials.

How to Use the Negative Binomial Calculator

  1. 1

    Enter n (the trial number / total events when the r-th success happens).

  2. 2

    Enter r (the number of successes you’re aiming for).

  3. 3

    Enter p (probability of success on one trial).

  4. 4

    Read the result for P(Y = n) and the combinations term C(n-1, r-1).

Frequently Asked Questions

What is negative binomial distribution?

It’s a distribution that models the number of trials needed to obtain r successes, assuming independent trials with constant success probability p.

When to use negative binomial distribution?

Use it when you’re asking “how many trials until r successes?” or “what’s the probability the r-th success happens on trial n?”

Can binomial distribution be negative?

The word “negative” doesn’t mean probabilities are negative. It refers to a different model than the (regular) binomial distribution: instead of fixing the number of trials and counting successes, you fix the number of successes and model how many trials it takes.

What are common negative binomial distribution problems?

Typical problems ask for P(Y=n) (the r-th success occurs on trial n) or probabilities about needing at most/at least a certain number of trials to reach r successes.

What happens if n is less than r?

It’s impossible to have r successes by trial n if n < r, so the probability P(Y=n) is 0 in that case.