Negative Binomial PMF Calculator

Enter failures, target successes and the success probability to get the PMF.

Result

0.124416
4.5000
3.3541

How it is calculated

The tool gives the probability of exactly k failures before the r-th success: P(X = k) = C(k + r − 1, k) · pr · (1 − p)k. Here p is the success probability of each independent trial (above 0, up to 1), r the target number of successes (at least 1) and k the failures observed (0 up to 1,000,000; more gives no result). It also reports the mean r(1 − p) / p and the standard deviation √(r(1 − p) / p²). The count k and r are rounded to whole numbers. Results are shown with six decimals for the probability and four for mean and sd. This is the failures-before-success form, so the total number of trials is k + r, not k.

Worked example

A sales rep wins a deal on 40% of calls (p = 0.4) and wants three deals (r = 3). What is the chance of exactly 4 unsuccessful calls before the third win? The count of arrangements is C(4 + 3 − 1, 4) = C(6, 4) = 15. Then 0.4³ = 0.064 and 0.6⁴ = 0.1296. Multiply: 15 × 0.064 × 0.1296 = 0.124416, about a 12.4% chance. The expected number of failures is 3 × 0.6 / 0.4 = 4.5 and the standard deviation is 3.3541.

Try this example →

Common mistakes

  • Counting total trials as k. In this form k counts only the failures; the total number of trials is k + r, and the last trial is always a success.
  • Using the number of trials in the k field. If a process needed 7 calls to get 3 wins, then k is 4, not 7.
  • Entering the probability as a percentage. The field takes a value between 0 and 1, so 40% must be typed as 0.4.
  • Treating the PMF as a cumulative probability. The result is the chance of exactly k failures, not k or fewer, so add several values to get a cumulative figure.
  • Mixing it up with the binomial distribution. The binomial fixes the number of trials and counts successes, while here the number of successes is fixed and the number of trials varies.

About this calculator

The negative binomial distribution models the number of failures k observed before achieving a fixed number of successes r, in a sequence of independent trials each with success probability p. Its probability mass function is P(X=k) = C(k+r−1, k) · p^r · (1−p)^k, with mean μ = r(1−p)/p and variance σ² = r(1−p)/p² — a distribution that, unlike the Poisson, allows variance to exceed the mean, making it useful for “overdispersed” count data.

This calculator takes the number of failures, the target number of successes, and the per-trial success probability, and returns the PMF along with the distribution's mean and standard deviation. Statisticians and actuaries use it to model overdispersed count data such as insurance claim frequencies, and quality-control engineers use it to estimate how many defective units to expect before hitting a target number of good ones in a production run.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The tool returns the probability of exactly k failures, not of k or fewer. For a cumulative question such as at most 4 failures before your 3rd success, run k = 0, 1, 2, 3 and 4 in turn and add the results. A handy check is the mean it reports: the PMF peaks near that value, so a k far above the mean should give a small number. What process are you modelling, calls to close deals, defective parts, or something else?

Popular calculators

All Calculators