🧮
🧮 Math & statistics

Negative Binomial Distribution Calculator (probability of the r-th success)

Results update as you type.

Your numbers

Understanding the negative binomial distribution calculator — concept and principle

This calculator gives probabilities for the negative binomial distribution: how long you wait, in trials or failures, until the r-th success in repeated independent trials with the same success chance p. Use it for questions such as "how many sales calls until the third sale" or "how many free throws until the fifth make", and for exact, cumulative and tail probabilities.

Negative binomial exampleWaiting for the 3rd success (p = 0.4)F1S2F3F4S5F6F7S8one of C(7,2) = 21 orders · last trial is a success21 × 0.4³ × 0.6⁵P(X = 8)0.104509mean 7.5 trials · SD 3.354
The 3rd success on trial 8 means 2 successes and 5 failures before it in any order.

How it is calculated

With k failures before the r-th success:

P(k) = C(k + r − 1, r − 1) · p^r · (1 − p)^k, k = 0, 1, 2, …

The principle

For the r-th success to land on trial k + r, two things must happen. The last trial must be a success (probability p), and the first k + r − 1 trials must contain exactly r − 1 successes and k failures in any order. The number of such orders is C(k + r − 1, r − 1), and each order has probability p^(r−1)(1 − p)^k because trials are independent. Multiplying gives the formula. With r = 1 it becomes the geometric distribution.

Worked example

Default inputs: r = 3, p = 0.4, X counts total trials, X = 8.

  1. Failures before the 3rd success: k = 8 − 3 = 5.
  2. C(7, 2) = 21; p³ = 0.064; 0.6⁵ = 0.07776.
  3. P(X = 8) = 21 × 0.064 × 0.07776 = 0.104509.
  4. P(X ≤ 8) = 0.684605, so P(X > 8) = 0.315395; P(X < 8) = 0.580096 and P(X ≥ 8) = 0.419904.
  5. Mean = 3 ÷ 0.4 = 7.5 trials; variance = 3 × 0.6 ÷ 0.16 = 11.25; standard deviation = 3.3541.
How P(X = x) changes with Probability of success per trial pHow P changes with Probability of succes…00.0250.050.0750.10.1250.10.20.30.40.50.60.8Example: 0.104509Probability of success per trial p
Each point is the calculator re-run with only “Probability of success per trial p” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Probability of success per trial pP(X = x)
0.10.0124003
0.20.0550502
0.30.0952957
0.40.104509
0.50.0820313
0.60.0464486
0.80.00344064

How to read the result

P(X = x) is the chance that the r-th success happens exactly on that trial. P(X ≤ x) is the chance you are done by then, which is useful for planning ("how likely am I to need no more than 8 attempts?"). A large P(X > x) warns that the wait often runs longer. The mean shows the typical wait; a standard deviation that is large relative to the mean means waiting times vary a lot.

Common mistakes

Keep in mind: The model assumes independent trials with a constant success probability. Real processes, such as sales or sports, often break these assumptions, so treat results as an idealised estimate.

Frequently asked questions

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

The geometric distribution is the special case r = 1: the wait for the first success.

Why is the variance the same in both conventions?

Trials equal failures plus the constant r, and adding a constant shifts the mean but not the spread.

Can X be smaller than r?

Not when counting trials. You need at least r trials to get r successes, so the smallest value is r.

Sources: Weisstein, E. W., "Negative Binomial Distribution", Wolfram MathWorld

Checked 9 Nov 2026. Weisstein, E. W., “Negative Binomial Distribution”, Wolfram MathWorld (x failures before the r-th success, P(x) = C(x + r − 1, r − 1)·p^r·(1 − p)^x, eq. 3; mean rq/p, eq. 23; variance rq/p², eq. 24; q = 1 − p).

🧮 All math & statistics tools →🌍 Calculators by country →