About the Negative Binomial Distribution Calculator
This negative binomial distribution calculator answers questions like “what is the probability that the third sale happens on the eighth call?” Enter the number of successes you need (r), the probability of success on each trial (p) and the trial number (k), and it returns the exact probability P(X = k), the cumulative probabilities P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k), and the distribution’s mean, variance, standard deviation and mode, with a probability chart and table.
The negative binomial models repeated independent trials with the same success probability, counted until a fixed number of successes is reached — sales calls until three closes, free throws until five makes, inspections until the second defect, or attempts until a goal is hit. With r = 1 it reduces to the geometric distribution. Students use it for probability homework; analysts use it for planning (how many calls to budget) and risk (how likely is it to take more than 20 attempts).
Two conventions are in common use, and the calculator supports both: counting the total number of trials needed for r successes (the default, X ≥ r), or counting the number of failures before the r-th success (Y = X − r, the form used by SciPy, R’s dnbinom and Excel’s NEGBINOM.DIST). Pick the one your textbook or software uses so the numbers match.
With the default inputs, the p(exactly k) is 0.095296. Change any value above to recalculate instantly.
How to use the negative binomial distribution calculator
- 1Enter how many successes you need (r).
- 2Enter the probability of success on each trial as a percentage.
- 3Choose whether you are counting total trials or failures before the r-th success.
- 4Enter the value of interest k and read the exact and cumulative probabilities.
Formula and method
For the r-th success to arrive on exactly trial k, trial k must be a success and the previous k − 1 trials must contain exactly r − 1 successes. There are C(k − 1, r − 1) ways to place those earlier successes, each with probability pʳ(1 − p)^(k − r). Counting failures instead shifts the variable by r: Y = X − r, so the variance is unchanged and the mean becomes r(1 − p)/p.
Cumulative probabilities are computed with the regularized incomplete beta function, P(Y ≤ y) = I_p(r, y + 1), which is exact and fast even for very large k. The model assumes independent trials, a constant success probability p, and that you keep going until exactly r successes are reached.
- r
- Number of successes required
- p
- Probability of success on each trial
- k
- Trial on which the r-th success occurs (X form)
- y
- Number of failures before the r-th success (Y form), y = k − r
- C(n, j)
- Binomial coefficient, n choose j
Worked examples
Third sale on the eighth call
A salesperson closes 30% of calls. P(X = 8) = C(7, 2) × 0.3³ × 0.7⁵ = 21 × 0.027 × 0.16807 ≈ 0.0953. There is a 44.8% chance of the third sale by call 8, the average is 3 ÷ 0.3 = 10 calls, and the single most likely call for the third sale is the seventh.
Fifth heads on the tenth coin flip
P(X = 10) = C(9, 4) × 0.5¹⁰ = 126 ÷ 1,024 ≈ 0.1230. The mean is 5 ÷ 0.5 = 10 flips and the standard deviation √(5 × 0.5) ÷ 0.5 ≈ 3.16. Because (r − 1)(1 − p)/p = 4 is a whole number, trials 8 and 9 are equally likely modes.
Failures form: two misses before the fourth hit
Counting failures, P(Y = 2) = C(5, 2) × 0.6⁴ × 0.4² = 10 × 0.1296 × 0.16 = 0.2074 — the same value Excel’s NEGBINOM.DIST(2, 4, 0.6, FALSE) returns. The expected number of misses is 4 × 0.4 ÷ 0.6 ≈ 2.67.
Frequently asked questions
What is the negative binomial distribution?+
It gives the probability of needing a certain number of independent trials (or failures) to reach a fixed number of successes r, when each trial succeeds with the same probability p. It is also called the Pascal distribution when r is a whole number.
How is it different from the binomial distribution?+
The binomial fixes the number of trials and counts successes. The negative binomial fixes the number of successes and counts how many trials (or failures) it takes to reach them.
How does the negative binomial relate to the geometric distribution?+
The geometric distribution is the special case r = 1: the number of trials until the first success. A negative binomial with r successes is the sum of r independent geometric waiting times.
Why does my textbook give a different answer from Excel?+
Excel’s NEGBINOM.DIST, R’s dnbinom and SciPy count failures before the r-th success, while many textbooks count total trials. Switch the Count setting to match; the two answers agree when the failures value equals k − r.
What are the mean and variance of the negative binomial distribution?+
Counting trials, the mean is r/p and the variance r(1 − p)/p². Counting failures, the mean is r(1 − p)/p and the variance is the same r(1 − p)/p².