negative binomial distribution calculator

Interactive Negative Binomial Calculator

Assumption: K is the number of failures observed before the r-th success, with success probability p on each independent trial.

Use this tool to compute exact and cumulative probabilities for the negative binomial distribution. It is useful in reliability analysis, quality control, A/B testing, and any scenario where you count failures until a fixed number of successes is reached.

What is the negative binomial distribution?

The negative binomial distribution models the number of failures before reaching a specified number of successes in repeated independent Bernoulli trials. Each trial has two outcomes (success/failure), and the success probability remains constant from trial to trial.

Parameterization used on this page

  • r: required number of successes (positive integer)
  • p: probability of success on each trial (0 < p ≤ 1)
  • K: random variable for the number of failures before the r-th success
PMF: P(K = k) = C(k + r - 1, k) (1 - p)^k p^r, for k = 0, 1, 2, ...
Mean (failures): E[K] = r(1 - p)/p
Variance: Var(K) = r(1 - p)/p²

How to use the calculator

  1. Choose the probability type: exact, cumulative up to k, or upper-tail from k.
  2. Enter r, the number of successes you want to reach.
  3. Enter p, the success probability on each trial.
  4. Enter k, the failure count of interest.
  5. Click Calculate.

Worked example

Suppose a sales rep closes a deal with probability 0.25 each call. You want to know the probability of exactly 6 failed calls before the 3rd closed deal:

  • r = 3
  • p = 0.25
  • k = 6

The calculator returns P(K = 6), plus summary statistics like expected failures and expected total calls.

When this distribution is appropriate

  • Repeated, independent trials
  • Constant success probability across trials
  • You stop after a fixed number of successes
  • You care about the number of failures (or total trials) needed
Tip: If you prefer total trials N instead of failures K, use the relation N = K + r.

Common mistakes to avoid

  • Confusing binomial with negative binomial (fixed number of trials vs fixed number of successes).
  • Using non-integer values for r or k.
  • Using p outside the range (0, 1].
  • Applying this model when trial outcomes are not independent.

Quick FAQ

Is this the same as the geometric distribution?

The geometric distribution is a special case of the negative binomial with r = 1.

What does “at most k failures” mean?

It means P(K ≤ k), which sums exact probabilities from 0 through k.

What does “at least k failures” mean?

It means P(K ≥ k), the probability of needing k or more failures before reaching r successes.

🔗 Related Calculators