Negative Binomial Distribution Calculator

Quick answer

The negative binomial distribution calculator finds the probability that the r-th success happens on trial n (or after a given number of failures), with exactly, at most, at least, fewer than and more than probabilities, the combination term, the mean, variance and a highlighted chart.

%
Requested probability
1.2733 %
Negative binomial distribution
P(X = k)
1.2733 %
P(X ≤ k)
3.4392 %
P(X ≥ k)
97.8342 %
P(X < k)
2.1658 %
P(X > k)
96.5608 %
Combinations C(n − 1, r − 1)
1,961,256
Mean (expected value)
37.5
Variance
56.25
Standard deviation
7.5
Mode
36
Skewness
0.5333

The binomial distribution fixes the number of trials and counts the successes. The negative binomial distribution turns that around: it fixes the number of successes r you are waiting for and counts how many trials it takes to get them. How many free-throw attempts until a player scores 10 times? How many leaflets must a canvasser hand out before 15 people sign up?

For the r-th success to land exactly on trial n, the last trial must be a success and the first n − 1 trials must contain exactly r − 1 successes in any order – which gives the term C(n − 1, r − 1)·pʳ·(1 − p)^(n − r). With r = 1 it reduces to the geometric distribution.

The calculator supports both common definitions: the total number of trials Y (starting at r) and the number of failures X = Y − r before the r-th success (starting at 0), which is also widely used as an over-dispersed alternative to the Poisson distribution for count data. It returns the exact, cumulative and tail probabilities, the combination term, the mean, variance, standard deviation, mode and skewness, and highlights the requested outcomes on the chart.

How to use the Negative Binomial Distribution Calculator

  1. Number of successes needed (r)
  2. Probability of one success (p)
  3. Number of trials n (or failures)
  4. Count
  5. Probability of

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

The probability of the r-th success on trial n multiplies the C(n − 1, r − 1) arrangements of the earlier successes by pʳ(1 − p)^(n − r). Cumulative probabilities add these terms (computed through the regularised incomplete beta function).

Worked example

A canvasser needs 15 sign-ups and each leaflet succeeds with p = 0.4. The probability that the 15th sign-up comes with exactly the 25th leaflet is C(24, 14) × 0.4¹⁵ × 0.6¹⁰ = 1,961,256 × 0.4¹⁵ × 0.6¹⁰ = 1.273%. Reaching 15 sign-ups within 25 leaflets has probability 3.44%, because on average 15/0.4 = 37.5 leaflets are needed (standard deviation 7.5).

Two definitions compared

Measure Trials Y (n = r, r + 1, …) Failures X = Y − r (0, 1, …)
P(·) C(n − 1, r − 1) pʳ (1 − p)^(n − r) C(x + r − 1, x) pʳ (1 − p)ˣ
Mean r/p r(1 − p)/p
Variance r(1 − p)/p² r(1 − p)/p²

Formula

P(Y = n) = C(n − 1, r − 1) × pʳ × (1 − p)^(n − r), n = r, r + 1, … · mean = r/p · variance = r(1 − p)/p² · failures version: X = Y − r, mean r(1 − p)/p

Worked example

Inputs — Number of successes needed (r): 15; Probability of one success (p): 40 %; Number of trials n (or failures): 25; Count: Total trials n until the r-th success (n = r, r + 1, …); Probability of: Exactly – P(Y = n).
Results — Requested probability = 1.2733 %; P(X = k) = 1.2733 %; P(X ≤ k) = 3.4392 %; P(X ≥ k) = 97.8342 %; P(X < k) = 2.1658 %; P(X > k) = 96.5608 %.

Key terms

Negative binomial distribution
The number of trials (or failures) needed to reach a fixed number of successes r.
Number of successes (r)
The target count of successes; also called the size parameter.
Over-dispersion
Variance larger than the mean, a sign that a Poisson model is too narrow.

Frequently asked questions

What is the difference between the binomial and negative binomial distributions?

The binomial fixes the number of trials and counts successes; the negative binomial fixes the number of successes and counts trials (or failures).

What is the probability that the third six appears on the 10th roll?

C(9, 2) × (1/6)³ × (5/6)⁷ = 4.65%.

How many trials are expected for r successes?

r/p. For three sixes that is 3 ÷ (1/6) = 18 rolls, with variance 90.

Is the geometric distribution a special case?

Yes – with r = 1 the negative binomial is the geometric distribution.

Why is it used for count data?

Its variance exceeds its mean, so it fits over-dispersed counts (accidents, insurance claims, species abundance) better than the Poisson.

Which version does the calculator use?

Both: choose "total trials" (as in most probability courses) or "failures before the r-th success" (as in R and many statistics packages).

Sources

  1. NIST/SEMATECH e-Handbook – Gallery of distributions
  2. Penn State STAT 414 – Introduction to Probability Theory
  3. Wolfram MathWorld – Probability and statistics

Cite this calculator

Speedy Calculator. (2026). Negative Binomial Distribution Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/negative-binomial-distribution/