Calculate negative binomial probabilities — failures before the r-th success — with full distribution table, visual chart, and parameter sensitivity analysis.
The negative binomial distribution calculator computes the probability of observing exactly k failures before achieving r successes in a sequence of independent Bernoulli trials. While the binomial distribution fixes the number of trials and asks "how many successes?", the negative binomial fixes the number of successes and asks "how many failures (or trials) until we get there?"
This distribution appears in quality control (how many good items before r defectives?), sales (how many calls before r sales?), ecology (species abundance modeling), and genomics (RNA-seq count data). When r = 1, it reduces to the geometric distribution.
Enter the target number of successes (r), success probability (p), and desired failure count (k) to get point and cumulative probabilities, a full distribution chart and table, and sensitivity analysis across different success rates. Check the example with realistic values before reporting. Use the steps shown to verify rounding and units. Cross-check this output using a known reference case.
The negative binomial distribution is essential for "waiting time" problems — when you need to know how many trials until achieving a target number of successes. This calculator provides the complete probability landscape with visual tools, making it easy to reason about expected effort and variability.
Critical for bioinformaticians (RNA-seq), quality engineers (reliability testing), sales managers (pipeline modeling), and students studying discrete distributions.
P(X = k) = C(k+r−1, k) × p^r × (1−p)^k. Mean = r(1−p)/p. Variance = r(1−p)/p². Mode = ⌊(r−1)(1−p)/p⌋ for r > 1.
Result: P(X = 10) ≈ 0.0805 (8.05%)
With r = 3 successes needed at p = 20% per trial, the probability of exactly 10 failures (13 total trials) before the 3rd success is about 8.05%.
In ecology, the number of species in a sample often shows variance much greater than the mean — overdispersion. The negative binomial handles this by adding a "clumping" parameter. If individual counts follow Poisson(λ) and λ itself follows a Gamma distribution, the marginal distribution of counts is negative binomial.
The negative binomial arises naturally as a Poisson-Gamma mixture. Starting with a Poisson likelihood and Gamma prior on the rate, the predictive distribution is negative binomial. This makes it fundamental in Bayesian count regression and hierarchical models.
For count data: Poisson (variance = mean), negative binomial (variance > mean), and COM-Poisson (flexible variance). The negative binomial sits in the "sweet spot" of handling overdispersion while remaining computationally tractable, making it the default choice in many applied fields.
Binomial: fixed n trials, random number of successes. Negative binomial: fixed r successes, random number of failures (or trials). They answer complementary questions.
The PMF involves binomial coefficients with negative upper index (via the generalization C(−r, k)). The "negative" refers to this mathematical connection, not a negative probability.
The geometric distribution is the special case r = 1: how many failures before the first success. The negative binomial generalizes to r successes.
Yes. The continuous generalization uses Γ(k+r)/(k!Γ(r)) instead of C(k+r−1,k), allowing any r > 0. This is commonly used in overdispersion modeling.
Gene expression counts show more variance than a Poisson would predict (overdispersion). The negative binomial adds an extra parameter to capture this biological variability, making it the standard for differential expression analysis.
Total trials = failures + successes = k + r. If you observe k = 10 failures before r = 3 successes, you performed 13 trials total.