Calculators
Home › Calculators › Negative Binomial Distribution

Negative Binomial Distribution Calculator

Waiting for the second, third, r-th success: the geometric's bigger sibling.

Negative binomial probabilities

Successes required r, per-trial probability p, and the trial k to price.

Quick answer: Third head of a fair coin on trial 5: 0.1875. Done within 5 trials: 0.5000. Mean wait r/p = 6 trials. Set r = 1 and it is the geometric distribution.

Trials until the r-th success

The negative binomial generalises the geometric question: instead of the first success, wait for the r-th. The r-th success must land exactly on trial k, which pins the structure of the count: among the first k − 1 trials there are exactly r − 1 successes, in any order, and trial k is a success. Hence P(X = k) = C(k − 1, r − 1) pr (1 − p)k−r. Sales calls until the third order, at-bats until the fifth hit, inspections until the second defect: any quota-based wait has this shape.

Worked example

Fair coin, third head wanted (r = 3, p = 0.5). It arrives on trial 5 with probability C(4, 2) × 0.55 = 6/32 = 0.1875. The fastest possible finish, trial 3, has probability 0.125. Done within five trials: 0.125 + 0.1875 + 0.1875 = 0.5000, a pleasingly round answer for this p. The mean wait is r/p = 6 trials, variance r(1 − p)/p² = 6.

Why "negative"?

The name is a historical accident of algebra: the probabilities can be written with a binomial coefficient whose top entry is negative, C(−r, k)-style, when the formula is rearranged to count failures instead of trials. Nothing in the distribution is negative. Watch for the convention split, as with the geometric: some texts and software count the failures before the r-th success rather than the trial it lands on, shifting every answer by r. The calculator on this page counts trials, so its smallest possible value is r itself.

Watch out

Reaching for the negative binomial for "exactly r successes in n trials": that is the plain binomial. The negative binomial fixes the success count and lets the trial count vary; the binomial does the opposite.

Frequently asked questions

How is the negative binomial different from the geometric?

The geometric is the special case r = 1. The negative binomial waits for the r-th success; its mean r/p and variance r(1 - p)/p^2 reduce to the geometric formulas at r = 1.

What is the mean number of trials to get r successes?

r/p. Three successes at p = 0.5 average 6 trials, with a standard deviation of sqrt(6), about 2.45.

Can the negative binomial model overdispersed counts?

Yes, in its regression form it is the standard fix when count data vary more than a Poisson allows, which is why it appears throughout ecology and insurance work.