search

Found

info Overview

Read PMF, CDF, and survival of the negative binomial NB(r, p) plus mean, variance, and mode at once. Covers r 1-1000, p 0.01-0.99 with log-gamma precision.

📘 How to Use

  1. Enter the target number of successes r (integer 1 to 1000)
  2. Drag the success probability p slider (0.01 to 0.99)
  3. Type the failure count k to update PMF, CDF, survival, mean, variance, std deviation, and mode

Negative Binomial Distribution Probability Calculator

1 to 1000
0.30

Range 0.01 to 0.99

0 to 2000

※ PMF = C(k+r-1, k) · p^r · (1-p)^k, the probability of k failures before the r-th success.

※ This tool uses the convention where k counts failures observed before the r-th success.

PMF P(X=k)
CDF P(X≤k)
Survival P(X≥k)

Distribution statistics

Mean
Variance
Std. deviation
Mode
Copied!
Article

Negative Binomial Distribution Probability Calculator | PMF, CDF & Survival at a Glance

Enter the target successes r, success probability p, and failure count k to read the PMF, CDF, and survival probability of the negative binomial distribution NB(r, p), plus mean, variance, standard deviation, and mode — all on one screen. Supports r from 1 to 1000 and p from 0.01 to 0.99.

💡 About this tool

The negative binomial distribution models "how many failures happen before the r-th success," and it shows up constantly in reliability engineering, experiment design, and A/B test planning. Computing it by hand is painful: the binomial coefficient C(k+r-1, k) blows up fast, and a pocket calculator overflows once k+r climbs into the hundreds.

This tool evaluates the coefficient in log space using a log-gamma function (Lanczos approximation), so the PMF stays accurate even when k+r reaches the thousands without numerical overflow. PMF, CDF, and survival sit in three side-by-side cards, so you can sweep the k threshold and read "exactly k failures," "at most k failures," and "k or more failures" in one pass.

One convention note worth bookmarking: this tool defines k as the number of failures observed before the r-th success (the SciPy / Wikipedia parameterization). Some textbooks instead define k as the trial number on which the r-th success lands, which shifts the formula. The note under the inputs spells out which one is in play.

🧐 Frequently Asked Questions

Q. How is this different from the binomial distribution? A. The binomial fixes the number of trials and counts successes; the negative binomial fixes the number of successes r and counts failures. Heads in five coin flips follows a binomial; tails seen while flipping until five heads appear follows a negative binomial.

Q. What happens when r = 1? A. With r = 1 the negative binomial collapses to the geometric distribution — failures before the first success. The negative binomial is simply the geometric generalized to r successes.

Q. What is the survival value P(X ≥ k) good for? A. It is the probability of seeing k or more failures before reaching r successes. Reach for it when you want to size the risk that failures exceed a budget — for example, "what is the chance I burn 20+ calls before closing 5 deals?"

Q. What are the mean and variance formulas? A. Mean is r(1-p)/p, variance is r(1-p)/p², and the standard deviation is the square root of the variance. Smaller p means both the expected failures and the spread grow.

Q. Can I plug in large values of k? A. k ranges from 0 to 2000 and r from 1 to 1000. The CDF sums PMF terms from 0 up to k, so a larger k simply means more terms in the running sum.

📚 Why the name has a minus sign

The "negative" in negative binomial comes from the algebra, not the values — the probability generating function expands into binomial coefficients with a negative exponent, courtesy of Newton's generalized binomial theorem that extends (a+b)^n to non-integer and negative powers.

In applied work it earns its keep as the go-to model for overdispersion. When count data has variance larger than its mean, a Poisson model underfits, and the negative binomial steps in. The reason is elegant: treat the Poisson rate λ as itself gamma-distributed, integrate it out, and the marginal distribution is exactly negative binomial — which is why Poisson-gamma mixtures and negative binomial regression are two ways of describing the same idea.