Negative Binomial Distribution Calculator
Calculate negative binomial distribution probabilities for modeling the number of trials or failures needed to achieve a target number of successes. Get exact PMF, CDF, step-by-step solutions, interactive charts, and trial sequence visualizations.
Your ad blocker is preventing us from showing ads
MiniWebtool is free because of ads. If this tool helped you, please support us by going Premium (ad‑free + faster tools), or allowlist MiniWebtool.com and reload.
- Allow ads for MiniWebtool.com, then reload
- Or upgrade to Premium (ad‑free)
About Negative Binomial Distribution Calculator
The Negative Binomial Distribution Calculator computes exact probabilities for the number of failures (or total trials) needed before achieving a target number of successes. Enter the number of successes needed (r), the per-trial success probability (p), and your target value (k) to get point and cumulative probabilities, step-by-step solutions, interactive charts, and a trial sequence visualization.
What Is the Negative Binomial Distribution?
The negative binomial distribution is a discrete probability distribution that models the number of failures before a specified number of successes occurs in a sequence of independent Bernoulli trials. Each trial has the same success probability p. It answers questions like "How many failed sales calls will I make before closing my 5th deal?" or "How many defective items will I inspect before finding 10 good ones?"
The distribution gets its name from the negative binomial series expansion used in its derivation. It generalizes the geometric distribution, which is the special case where r = 1 (one success needed).
Two Common Parameterizations
The negative binomial distribution has two equivalent formulations that differ in what the random variable counts:
- Failures parameterization (X): X counts only the failures before the r-th success. X can be 0, 1, 2, 3, ... The PMF is P(X = k) = C(k + r − 1, r − 1) × pr × (1 − p)k.
- Trials parameterization (Y): Y counts the total number of trials (both successes and failures) until the r-th success. Y can be r, r+1, r+2, ... The relationship is Y = X + r.
This calculator supports both. Use the toggle to switch between entering k as the number of failures or the total number of trials.
The Negative Binomial PMF Formula
In the failures parameterization, the probability mass function is:
P(X = k) = C(k + r − 1, r − 1) × pr × (1 − p)k
Where C(n, k) = n! / (k! × (n − k)!) is the binomial coefficient. The term C(k + r − 1, r − 1) counts the number of ways to arrange k failures and r − 1 successes in the first k + r − 1 trials (the last trial must be a success). The term pr is the probability of r successes, and (1 − p)k is the probability of k failures.
Mean, Variance, and Other Statistics
For the negative binomial random variable X (failures parameterization) with parameters r and p:
- Mean: μ = r(1 − p) / p
- Variance: σ² = r(1 − p) / p²
- Standard Deviation: σ = √(r(1 − p) / p²)
- Mode: ⌊(r − 1)(1 − p) / p⌋ when r > 1; 0 when r = 1
- Skewness: (2 − p) / √(r(1 − p))
For the trials parameterization Y = X + r, the mean shifts to r/p and the variance stays the same.
Relationship to Other Distributions
- Geometric distribution: The special case with r = 1. Models the number of failures before the first success.
- Binomial distribution: While the binomial fixes the number of trials and counts successes, the negative binomial fixes the number of successes and counts trials/failures.
- Poisson distribution: The negative binomial can be viewed as a Poisson-Gamma mixture. As r → ∞ and p → 1 while keeping r(1 − p)/p constant, the negative binomial approaches a Poisson distribution.
Common Applications
- Sales and marketing — How many calls until a salesperson closes their target number of deals, given a known conversion rate?
- Quality control — How many items must be inspected to find a target number of conforming units?
- Clinical trials — How many patients need to be enrolled before obtaining a target number of positive responses?
- Insurance — Modeling claim counts when the variance exceeds the mean (overdispersion relative to the Poisson).
- Ecology — Modeling species abundance data where counts show more variability than a Poisson model allows.
- Sports analytics — How many shots or attempts until an athlete reaches a target number of successful outcomes?
How to Use This Calculator
- Enter r, the number of successes you want to achieve (r ≥ 1).
- Enter p, the probability of success on each trial (0 < p ≤ 1).
- Select the input mode: whether k represents the number of failures or the total number of trials.
- Enter k, the specific value you want to find the probability for.
- Click "Calculate Probability" to see exact and cumulative probabilities, step-by-step combinatorial solutions, a trial sequence visualization, PMF/CDF charts, and the full distribution table.
Frequently Asked Questions
What is the difference between negative binomial and binomial distributions?
The binomial distribution fixes the number of trials and counts the random number of successes. The negative binomial fixes the number of successes and counts the random number of trials (or failures). They answer complementary questions: the binomial asks "How many successes in n trials?" while the negative binomial asks "How many trials until r successes?"
When should I use the negative binomial instead of the Poisson distribution?
Use the negative binomial when your count data shows overdispersion — when the variance is greater than the mean. The Poisson distribution assumes equal mean and variance. The negative binomial has an extra parameter that allows the variance to exceed the mean, making it a better fit for many real-world count datasets.
What does it mean when r = 1?
When r = 1, the negative binomial reduces to the geometric distribution, which models the number of failures before the first success. For example, the number of coin flips showing tails before the first heads.
Can p equal 0 or 1?
The probability p must be strictly greater than 0. If p = 0, success is impossible so you'd need infinite trials. If p = 1, every trial is a success, so there are always 0 failures and the distribution is degenerate (all probability mass at k = 0). This calculator accepts p = 1 as a special case.
How is the negative binomial used in regression?
Negative binomial regression is a generalization of Poisson regression used when count data exhibits overdispersion. It adds a dispersion parameter that allows the conditional variance to exceed the conditional mean. Common applications include modeling hospital visit counts, traffic accident frequencies, and species abundance data.
Reference this content, page, or tool as:
"Negative Binomial Distribution Calculator" at https://MiniWebtool.com// from MiniWebtool, https://MiniWebtool.com/
by miniwebtool team. Updated: 2026-04-14
You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.