Negative Binomial Distribution Calculator
Calculate negative binomial probabilities for failures before r successes.
Enter success probability, target successes r, and observed failures k.
The negative binomial distribution counts the number of failures before achieving r successes in a sequence of independent trials, each with success probability p.
The probability mass function is P(X = k) = C(k + r - 1, k) * p^r * (1 - p)^k, where C(k + r - 1, k) counts the ways to arrange k failures among the k + r - 1 trials before the last success.
When r = 1, you get the geometric distribution: the number of failures before the first success. The negative binomial generalizes this to any target number of successes.
The mean of the distribution is r*(1-p)/p. If success probability is 0.4 and you need 3 successes, you expect on average 30.6/0.4 = 4.5 failures. The variance is r(1-p)/p^2, which is always larger than the mean. This is the key property that makes the negative binomial useful for overdispersed count data.
In ecology, the number of organisms caught per trap often shows more variability than a Poisson distribution can explain. Fitting a negative binomial handles the extra spread. Insurance claims, call center arrivals, and gene expression counts are other common applications.
The binomial answers “how many successes in n trials?” The negative binomial answers “how many trials until r successes?” They are conceptually related but count different things.
The parameter r does not have to be a positive integer. Generalizing to non-integer r gives the negative binomial distribution used in negative binomial regression (NB regression), a standard alternative to Poisson regression when counts are overdispersed. The formula extends using the gamma function in place of the factorial.
The cumulative probability P(X <= k) tells you the probability of achieving r successes within k + r trials or fewer, which is useful for scheduling and reliability problems.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.