Calculateus

Negative Binomial Probability Calculator

Calculate the probability of needing a specific number of failures before reaching a target number of successes.

Result

P(4 Failures Before 3 Successes)
12.442%
Expected Number of Failures
4.5

About the Negative Binomial

The Negative Binomial Probability Calculator finds the likelihood of accumulating a specific number of failures before reaching a target number of successes, with a fixed per-trial success probability. It applies to scenarios like sales calls, quality inspections, or repeated attempts where the process keeps running until a set number of "wins" is reached, and the number of "losses" along the way is what's uncertain.

How It Works

Enter the number of successes needed (r), the number of failures you want the probability for (k), and the probability of success on each trial (p). The calculator combines a combination term with the success and failure probabilities raised to their respective counts to compute the exact probability, and also reports the expected number of failures for that same success target.

P(k failures before r-th success) = C(k + r - 1, k) * p^r * (1 - p)^k. Expected number of failures = r * (1 - p) / p.

Formula & Methodology

The combination term C(k + r - 1, k) counts the number of distinct orderings of k failures and (r - 1) successes that can occur before the final, r-th success, which must be the last trial in the sequence. That coefficient is multiplied by p raised to the r successes and (1 - p) raised to the k failures to get the probability of one specific sequence length. The expected-failures formula follows directly from the distribution's mean.

Examples

Default case: 3 successes, 4 failures, p = 0.4

With r = 3, k = 4, and p = 0.4, C(6,4) = 15, and the probability is 15 * 0.4^3 * 0.6^4 = 15 * 0.064 * 0.1296, about 12.44%. The expected number of failures for this success target is 3 * 0.6 / 0.4 = 4.5.

Free-throw shooter aiming for 5 makes

A shooter who makes 70% of free throws (p = 0.7) wants the probability of exactly 2 misses before their 5th make. With r = 5, k = 2, C(6,2) = 15, and the probability is 15 * 0.7^5 * 0.3^2, about 22.69%, with an expected miss count of 5 * 0.3 / 0.7, roughly 2.14.

Advantages

  • Models a "stop when you hit the target" process directly, rather than forcing that scenario into a fixed-trial binomial framework it doesn't fit.
  • Reports the expected number of failures alongside the exact probability, giving both a single-scenario answer and a longer-run average in one calculation.
  • Uses an overflow-resistant iterative combination formula, keeping the computation stable across a wide range of success and failure counts.

Common Mistakes

  • Confusing this with the binomial distribution, which fixes the number of trials rather than the number of successes; the two answer different questions and aren't interchangeable.
  • Entering the total number of trials instead of the number of failures for the k field, when the calculator expects failures specifically, not trial count.
  • Treating the expected-failures figure as a guaranteed outcome rather than a long-run average, when any single run can land above or below it.

Edge Cases to Watch For

  • Successes needed (r) must be a positive whole number, failures (k) must be zero or a positive whole number, and probability (p) must be greater than 0 and no more than 1, or the calculator returns an error.
  • k = 0 is a valid input; it computes the probability of reaching all r successes with zero failures in between, i.e., r successes in a row.
  • The combination function is computed iteratively term by term rather than through raw factorials, which avoids overflow for larger success or failure counts.
  • As p approaches 1, the probability mass concentrates heavily on k = 0, since failures become increasingly unlikely on each trial.

Common Use Cases

  • Sales or operations teams estimating how many unsuccessful attempts typically precede reaching a fixed target number of wins.
  • Analysts modeling processes like quality inspections or enrollment drives that continue running until a set number of successes accumulates.
  • Anyone comparing a fixed-success-target scenario against a fixed-trial-count scenario to choose the right distribution for their data.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

How does this differ from the binomial distribution?

The binomial distribution fixes the number of trials and asks about the number of successes. The negative binomial distribution flips this around: it fixes the target number of successes and asks about the number of failures encountered along the way - useful for modeling things like how many sales calls fail before reaching a quota of wins.

Conclusion

The negative binomial distribution reframes the more familiar binomial setup around a target number of successes rather than a fixed number of trials, making it suited to processes that run until a quota is met. This calculator handles both the exact probability for a chosen failure count and the expected number of failures for the overall success target.