What this calculator does
The negative binomial extends the geometric distribution from waiting for one success to waiting for several. At a 40% success rate, the chance that the third success lands exactly on trial 8 is 10.5%.
The minimum possible trial is r itself, and the probability there is simply p to the power r: three successes in a row at 40% each gives 6.4%. From that floor the distribution rises to a peak and then falls away, unlike the geometric which decreases from the very first trial.
The formula
The rth success on trial k requires exactly r−1 successes among the first k−1 trials, followed by a success on trial k. That gives C(k−1, r−1) multiplied by p to the r and (1−p) to the k−r. The mean is r/p, which is simply r times the geometric waiting time, since each success takes 1/p trials on average.
| Term | Meaning |
|---|---|
| r | The number of successes to wait for. |
| k | The trial on which the rth success occurs. It cannot be less than r. |
| Expected trial | r/p, the average wait for the rth success. |
| Overdispersion | The negative binomial is also used as a count model where the variance exceeds the mean and Poisson fails. |
The inputs explained
| Field | What to enter |
|---|---|
| Successes needed (r) | Successes required. With r = 1 this reduces to the geometric distribution. |
| Success probability per trial (%) | Success probability per trial, as a percentage. |
| Trial of the rth success (k) | The trial to evaluate. It must be at least r, since you cannot get r successes in fewer than r trials. |
When to use it
Planning a sampling effort
How many units must be tested to find a set number of defects, at a known rate.
Estimating attempts for several wins
Any process needing multiple successes, where the question is how many attempts to budget for.
Modelling overdispersed counts
Where Poisson fails because the variance exceeds the mean, the negative binomial adds the extra parameter needed.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
When does the third success arrive at 40%?
The chance the third success lands on each trial.
| Trial (k) | P(rth success on trial k) | P(rth success by trial k) | Expected trial of the rth success |
|---|---|---|---|
| Trial 3 | 6.40% | 6.40% | 7.50 |
| Trial 5 | 13.8% | 31.7% | 7.50 |
| Trial 8 | 10.5% | 68.5% | 7.50 |
| Trial 12 | 3.55% | 91.7% | 7.50 |
Questions
What is the difference between negative binomial and binomial?
The binomial fixes the number of trials and asks how many successes. The negative binomial fixes the number of successes and asks how many trials. They answer opposite questions about the same underlying process.
Why is it called negative binomial?
Because the probabilities arise from expanding a binomial series with a negative exponent. The name describes the mathematics rather than anything about the distribution behaviour, which is why it is so unhelpful as a label.
Can k be less than r?
No. Getting r successes requires at least r trials, so the distribution has no probability below k = r. At exactly k = r the answer is p to the power r, the chance of succeeding every time from the start.
Why is it used for count data?
In a different parameterisation it becomes a flexible count model with separate mean and dispersion parameters. That makes it the standard replacement for Poisson when data is overdispersed, which real count data very often is.
For waiting on a single success, see the geometric distribution calculator. For counting events at a known rate, see the Poisson distribution calculator.