Negative Binomial Distribution - PMF, Mean, Variance, and Uses

#Algebra
TL;DR
The negative binomial distribution models the number of failures that occur before a fixed number of successes, rr, is reached in independent trials with success probability pp. Its PMF is P(X=k)=(k+r−1k),pr(1−p)kP(X = k) = \binom{k+r-1}{k}, p^{r}(1-p)^{k}, its mean is r(1−p)p\frac{r(1-p)}{p}, and its variance is r(1−p)p2\frac{r(1-p)}{p^{2}}. This article covers the definition, PMF, mean and variance, when to use it, how it relates to the binomial, geometric, and Poisson distributions, and six worked examples.
MV
Madhukar VLast updated on August 17, 202610 min read

The Distribution That Flips The Binomial's Question Around

The binomial distribution asks: in a fixed number of trials, how many successes? The negative binomial distribution turns that on its head - it fixes the number of successes and asks how many failures pile up before you get there.

That reframing sounds small, but it changes what the distribution is for. It is the natural model whenever you keep running trials until a target number of successes lands, and you want to know how long that takes.

What Is The Negative Binomial Distribution?

The negative binomial distribution is a discrete probability distribution that counts the number of failures, XX, occurring in a sequence of independent Bernoulli trials before a specified number of successes, rr, is achieved. Each trial has the same probability of success, pp, and probability of failure 1−p1 - p.

Two setup conditions define it:

  • The trials are independent and identical, each a success or failure - Bernoulli trials.

  • You stop when the rr-th success occurs. The number of trials is not fixed in advance; the number of successes is.

A quick anchor: define rolling a 66 on a die as a success (p=16p = \frac{1}{6}) and stop at the third six. The negative binomial then describes how many non-six rolls (failures) you rack up before that third six. When r=1r = 1, the distribution reduces to the geometric distribution - the count of failures before the first success. The successes-versus-failures counting builds directly on the binomial theorem and the combinatorics of a binomial coefficient.

A Note on conventions:

some textbooks count trials rather than failures, and some swap the roles of pp and 1−p1-p. This article uses the common convention: XX is the number of failures before the rr-th success, with pp the success probability. Always check which version a source uses before comparing formulas.

What Is The PMF Of The Negative Binomial Distribution?

The probability mass function (PMF) gives the probability of exactly kk failures before the rr-th success:

P(X=k)=(k+r−1k),pr(1−p)k,k=0,1,2,…P(X = k) = \binom{k + r - 1}{k}, p^{r} (1 - p)^{k}, \qquad k = 0, 1, 2, \dots

Each piece has a plain meaning:

  • prp^{r} is the probability of the rr successes.

  • (1−p)k(1 - p)^{k} is the probability of the kk failures.

  • (k+r−1k)\binom{k + r - 1}{k} counts the ways to arrange those kk failures among the first k+r−1k + r - 1 trials - the rr-th success must land last, so only the earlier trials are free to shuffle.

That last point is the subtle part. You do not use (k+rk)\binom{k+r}{k}, because the final trial is pinned down as the rr-th success; only the k+r−1k + r - 1 trials before it can be rearranged. The coefficient is read from the binomial expansion machinery, where (nk)\binom{n}{k} counts selections.

What Are The Mean And Variance Of The Negative Binomial Distribution?

For XX counting failures before the rr-th success, with success probability pp:

Mean: μ=r(1−p)p\text{Mean: } \mu = \frac{r(1 - p)}{p} Variance: σ2=r(1−p)p2\text{Variance: } \sigma^{2} = \frac{r(1 - p)}{p^{2}}

Comparing the two lines shows a defining feature. The variance is the mean divided by pp:

σ2=μp.\sigma^{2} = \frac{\mu}{p}.

Since 0<p<10 < p < 1, dividing by pp makes the variance larger than the mean, always. This is overdispersion: the spread exceeds what the average alone would suggest. It is the single most important practical property of the distribution, and it is why the negative binomial is the go-to model for real count data that is more variable than a simpler model allows.

When Do You Use The Negative Binomial Distribution?

Reach for the negative binomial in two related situations.

  • Counting trials until a fixed number of successes. How many sales calls before closing the third deal? How many rolls before the third six? Whenever the successes are the stopping condition, not the trial count.

  • Modelling overdispersed count data. Real-world counts - insurance claims per customer, disease cases per region, defects per batch - often vary more than a Poisson model predicts (a Poisson forces variance to equal the mean). The negative binomial has a free second parameter that lets the variance exceed the mean, so it absorbs that extra scatter.

Examples Of Negative Binomial Distribution

The set runs from a direct PMF evaluation, through the parameter-confusion mistake, up to mean, variance, and a geometric special case.

Example 1

A basketball player makes each free throw with probability p=0.5p = 0.5. What is the probability of exactly 22 misses before the 33rd make?

Here a "success" is a make, r=3r = 3, and k=2k = 2 failures. Apply the PMF.

(k+r−1k)=(2+3−12)=(42)=6\binom{k + r - 1}{k} = \binom{2 + 3 - 1}{2} = \binom{4}{2} = 6 pr=(0.5)3=0.125p^{r} = (0.5)^{3} = 0.125 (1−p)k=(0.5)2=0.25(1 - p)^{k} = (0.5)^{2} = 0.25 P(X=2)=6×0.125×0.25=0.1875P(X = 2) = 6 \times 0.125 \times 0.25 = 0.1875

Final answer: 0.18750.1875, or 18.7518.75%.

Example 2

Find the mean number of misses before the 33rd make for the same player (r=3r = 3, p=0.5p = 0.5).

Use the mean formula, μ=r(1−p)p\mu = \frac{r(1-p)}{p}.

μ=3(1−0.5)0.5\mu = \frac{3(1 - 0.5)}{0.5} μ=3×0.50.5\mu = \frac{3 \times 0.5}{0.5} μ=3\mu = 3

Final answer: on average, 33 misses before the 33rd make.

Example 3

A quality inspector tests units until finding the 22nd defective. Each unit is defective with probability p=0.2p = 0.2. Find P(X=4)P(X = 4), the probability of 44 good units before the 22nd defective.

Wrong path. A student sets p=0.2p = 0.2 but plugs it into pk(1−p)rp^{k}(1-p)^{r}, attaching the success probability to the failures. That treats "good unit" as the success being counted, contradicting the setup where "defective" is the success (r=2r = 2). The exponents get swapped and the answer comes out wrong.

Correct. Keep pp with the rr successes (defectives) and 1−p1-p with the kk failures (good units).

(k+r−1k)=(4+2−14)=(54)=5\binom{k + r - 1}{k} = \binom{4 + 2 - 1}{4} = \binom{5}{4} = 5 pr=(0.2)2=0.04p^{r} = (0.2)^{2} = 0.04 (1−p)k=(0.8)4=0.4096(1 - p)^{k} = (0.8)^{4} = 0.4096 P(X=4)=5×0.04×0.4096=0.08192P(X = 4) = 5 \times 0.04 \times 0.4096 = 0.08192

Final answer: 0.081920.08192, about 8.28.2%. The probability pp always stays attached to the event you are counting toward.

Example 4

Find the variance for the inspector's setup (r=2r = 2, p=0.2p = 0.2).

Apply the variance formula, σ2=r(1−p)p2\sigma^{2} = \frac{r(1-p)}{p^{2}}.

σ2=2(1−0.2)(0.2)2\sigma^{2} = \frac{2(1 - 0.2)}{(0.2)^{2}} σ2=2×0.80.04\sigma^{2} = \frac{2 \times 0.8}{0.04} σ2=1.60.04=40\sigma^{2} = \frac{1.6}{0.04} = 40

Final answer: σ2=40\sigma^{2} = 40. The mean here is μ=2×0.80.2=8\mu = \frac{2 \times 0.8}{0.2} = 8, and 4040 is far larger — overdispersion in action.

Example 5

Show that with r=1r = 1 the PMF reduces to the geometric distribution.

Set r=1r = 1 in the PMF and simplify the coefficient.

(k+1−1k)=(kk)=1\binom{k + 1 - 1}{k} = \binom{k}{k} = 1 P(X=k)=1×p1(1−p)kP(X = k) = 1 \times p^{1}(1 - p)^{k} P(X=k)=p(1−p)kP(X = k) = p(1 - p)^{k}

Final answer: P(X=k)=p(1−p)kP(X = k) = p(1-p)^{k}, the geometric distribution — failures before the first success. The negative binomial contains the geometric as its r=1r = 1 case.

Example 6

A telemarketer closes a sale with probability p=0.25p = 0.25 per call and works until the 44th sale. What is the expected number of unsuccessful calls?

The failures are the unsuccessful calls; use the mean with r=4r = 4, p=0.25p = 0.25.

μ=r(1−p)p\mu = \frac{r(1 - p)}{p} μ=4(1−0.25)0.25\mu = \frac{4(1 - 0.25)}{0.25} μ=4×0.750.25=12\mu = \frac{4 \times 0.75}{0.25} = 12

Final answer: 1212 unsuccessful calls on average before the 44th sale.

How Does It Compare To The Binomial, Geometric, And Poisson?

The negative binomial sits inside a small family of counting distributions, and telling them apart comes down to what is fixed and what is counted.

Distribution

What is fixed

What is counted

Key relation

Binomial

Number of trials nn

Successes in nn trials

Fixed trials, count successes

Geometric

11 success

Failures before the 11st success

Negative binomial with r=1r = 1

Negative binomial

rr successes

Failures before the rr-th success

Sum of rr geometric variables

Poisson

Rate over an interval

Events in the interval

Negative binomial approaches it in a limit; variance forced to equal mean

The one-line summary: the binomial fixes trials and counts successes; the negative binomial fixes successes and counts failures. And where the Poisson demands variance equal to the mean, the negative binomial allows variance to exceed it, which is exactly the flexibility that makes it fit messy real data. This whole family leans on the same combinatorial counting captured in Pascal's triangle.

Common Mistakes

Mistake 1: Swapping p And 1−p In The PMF

Where it slips in: deciding which probability gets the exponent rr and which gets kk.

Don't do this: attach the success probability pp to the failures. The exponents then contradict the setup and every probability comes out wrong.

The correct way: prp^{r} goes with the rr successes you are waiting for; (1−p)k(1-p)^{k} goes with the kk failures. The memoriser who learned the formula as symbols without meaning is the one who flips them - anchoring pp to "the event I'm counting toward" fixes it.

Mistake 2: Confusing "Failures Before" With "Total Trials"

Where it slips in: reading the problem's random variable.

Don't do this: assume XX counts every trial. In this convention XX counts only the failures; the total number of trials is X+rX + r.

The correct way: decide up front whether the source counts failures or trials, and adjust. If a problem asks for total attempts, add rr to the failure count. The rusher who skips this reading answers a subtly different question.

Mistake 3: Assuming Variance Equals The Mean

Where it slips in: carrying a Poisson habit over to the negative binomial.

Don't do this: treat the variance as roughly equal to the mean. For the negative binomial the variance is always the mean divided by pp, hence strictly larger.

The correct way: compute the variance from its own formula, σ2=r(1−p)p2\sigma^{2} = \frac{r(1-p)}{p^{2}}, and expect it to exceed the mean. That gap is the overdispersion the model exists to capture.

Conclusion

  • The negative binomial distribution counts the failures before the rr-th success in independent trials with success probability pp.

  • Its PMF is P(X=k)=(k+r−1k)pr(1−p)kP(X = k) = \binom{k+r-1}{k} p^{r}(1-p)^{k}; the final trial is pinned as the rr-th success, which sets the coefficient.

  • The mean is r(1−p)p\frac{r(1-p)}{p} and the variance is r(1−p)p2\frac{r(1-p)}{p^{2}}; the variance always exceeds the mean, giving overdispersion.

  • With r=1r = 1 it becomes the geometric distribution; it is the flexible alternative to the Poisson for scattered count data.

  • The usual slips are swapping pp and 1−p1-p, confusing failures with total trials, and assuming variance equals the mean.

To build probability and statistics skills with a teacher, explore Bhanzu's high school math tutor sessions, one-to-one math tutoring, or structured math classes online. Want a live trainer to walk through distributions and their formulas? Book a free demo class with a Bhanzu trainer.

Read More

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the negative binomial distribution in simple terms?
It is the probability model for how many failures happen before you reach a fixed number of successes in repeated independent trials.
How is the negative binomial different from the binomial?
The binomial fixes the number of trials and counts successes. The negative binomial fixes the number of successes and counts the failures (or trials) needed to get there.
What are the mean and variance?
For XX counting failures before the rr-th success, the mean is r(1−p)p\frac{r(1-p)}{p} and the variance is r(1−p)p2\frac{r(1-p)}{p^{2}}: it is always the larger of the two.
What is overdispersion?
It is when count data varies more than its mean would predict. Because the negative binomial's variance exceeds its mean, it models overdispersed data that a Poisson cannot.
When should I use it instead of the Poisson?
Use it when your count data is overdispersed - the sample variance clearly exceeds the sample mean - or when you are counting trials until a set number of successes.
✍️ Written By
Madhukar V
Madhukar V
Math Columnist & Analyst
I see mathematics as more than just numbers and formulas—it is a way of thinking, questioning, and understanding the world around us. I work at the intersection of mathematics, EdTech, technology, and AI-powered learning, I enjoy exploring how mathematical ideas can be made simple, meaningful, and relatable. Through my articles, I aim to present mathematics with curiosity and a practical perspective, helping readers see the beauty and relevance behind every concept in a Bhanzu way.
LinkedIn
Related Articles
Book a FREE Demo ClassBook Now →