The Negative Binomial Distribution
The distribution for "how many tries until the r-th success" — a geometric distribution stacked r times. It doubles as the go-to fix for count data that's too spread out for a Poisson.
Prerequisites: The Geometric Distribution, The Binomial Distribution
The negative binomial distribution answers a slightly greedier version of the geometric question. Instead of "how many tries until the first success?", it asks "how many tries until the -th success?" Keep flipping a coin until you've seen three heads; keep taking trades until you've booked five winners; keep sending quotes until ten of them fill. The total number of attempts is negative binomial, and when it collapses straight back to the The Geometric Distribution.
Each attempt is an independent success-with-probability- trial. To have the -th success land on trial number , two things must happen: exactly of the first trials succeed (in any order), and the -th trial is the final success. That gives
The symbols: is the trial on which the -th success occurs, is how many successes you're waiting for, is the per-trial success probability, and counts the ways to arrange the earlier successes. You can't finish before trial , so the counts start at .
Mean and variance: geometric, times r
Because reaching the -th success is just separate first-success waits laid end to end, the mean and variance are simply copies of the geometric's:
Waiting for the first success takes tries on average, so waiting for of them takes , no derivation needed once you see it as stacked geometric waits.
The negative binomial is a stack of geometric waits: expected tries to the -th success is , and its variance is times the geometric's. Set and you recover the The Geometric Distribution exactly.
Worked example
You flip a fair coin () until you've collected three heads ().
- Expected number of flips: .
- Chance the third head lands on flip 5: you need exactly 2 heads among the first 4 flips, then a head,
- Chance you finish in the minimum 3 flips (three heads straight):
So six flips on average, but a healthy chance of finishing early, and a long right tail of unlucky runs that drags the mean above the peak.
The other life: modelling overdispersed counts
Here's the twist that makes the negative binomial a workhorse in statistics. The The Poisson Distribution insists that a count's mean and variance be equal. Real count data, defaults, order arrivals, insurance claims, is often overdispersed: its variance sits well above its mean because events cluster. Reparameterise the negative binomial by its mean and it becomes a Poisson whose rate is itself random (a Poisson–gamma mixture), giving you a spare knob to widen the variance independently of the mean. That flexibility is exactly why it's the standard replacement for the Poisson when counts are too bursty.
If your count data's variance is well above its mean, don't force a Poisson, fit a negative binomial. Its extra dispersion parameter lets the spread exceed the mean, which the Poisson structurally forbids.
Conventions differ: some texts count total trials to the -th success (support , mean ), others count failures before it (support , mean ). Same distribution, shifted by , always check which one a formula or library assumes.
The negative binomial ties the family together: it generalises the The Geometric Distribution (), mirrors the The Binomial Distribution with the roles of trials and successes swapped, and rescues you when the The Poisson Distribution is too rigid, one of the Common Distributions worth carrying in both of its guises.
Related concepts
Practice in interviews
Further reading
- Blitzstein & Hwang, Introduction to Probability, ch. 4
- Casella & Berger, Statistical Inference (ch. 3)