Skip to content
FiftyCalc Free calculators for all 50 states

Negative Binomial Distribution Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter the number of successes you wait for, the probability of success per trial and a number of failures k.

Result

Sample figures

P(exactly k failures)—

P(at most k failures) —

  • P(more than k failures)—
  • Total trials in this case (k + r)—
  • Mean number of failures—
  • Variance—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Negative Binomial Distribution Calculator

Successes wanted (r): enter 1 or more. Prefilled example: 3.

Probability of success per trial (0 to 1): enter a number from 0 to 1. Prefilled example: 0.4.

Failures before the r-th success (k): enter 0 or more. Prefilled example: 4.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Successes wanted (r): enter 1 or more.
  2. Probability of success per trial (0 to 1): enter a number from 0 to 1.
  3. Failures before the r-th success (k): enter 0 or more.
  4. Read the result: P(exactly k failures); the panel also shows P(at most k failures), P(more than k failures), Total trials in this case (k + r), Mean number of failures and Variance.

How this calculator works

Negative binomial distribution, counting the failures X before the r-th success in independent trials with success probability p: P(X = k) = C(k + r − 1, k) × p^r × (1 − p)^k.

P(X ≤ k) equals the probability of at least r successes in k + r trials, 1 − B(r − 1; k + r, p) with B the binomial cumulative distribution. Mean = r(1 − p) ÷ p, variance = r(1 − p) ÷ p².

Other texts count total trials N = X + r instead; the probabilities are the same, shifted by r. With r = 1 this is the geometric distribution.

The formula

  1. Eq=ncr⁡(k+r−1,k)×pr×(1−p)k
Symbols used in the formula
SymbolMeaning
rSuccesses wanted
pProbability of success per trial (0 to 1)
kFailures before the r-th success
EqP(exactly k failures)
ncr(n, k)the number of ways to choose k items from n, order ignored.

Worked example

Successes wanted (r)3
Probability of success per trial (0 to 1)0.4
Failures before the r-th success (k)4
P(at most k failures)0.5801
P(more than k failures)0.4199
Total trials in this case (k + r)7
Mean number of failures4.5
Variance11.25
  1. Eq=ncr⁡(4+3−1,4)×0.43×(1−0.4)4=0.124416

P(exactly k failures) 0.1244

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is the chance of the 3rd success coming after exactly 4 failures when p = 0.4?

C(6, 4) × 0.4³ × 0.6⁴ = 15 × 0.064 × 0.1296 ≈ 0.1244, on trial 7.

How is it related to the binomial distribution?

The binomial fixes the number of trials and counts successes; the negative binomial fixes the number of successes and counts the failures needed to reach it.

Questions answered

Related calculators