numvana

Negative Binomial Distribution Calculator

Find the probability that a target number of successes is reached on exactly, by, or only after a given trial number, for repeated trials with a fixed success probability.

P(r-th success is exactly on trial 5)
18.75%
P(r-th success occurs by trial 5)
50%
P(r-th success takes at least 5 trials)
68.75%
Expected trial number of the r-th success
6
Standard deviation (trials)
2.4495

How it works

The negative binomial distribution, in its "trial of the r-th success" form, models repeating independent trials with a fixed per-trial success probability p — the same fixed-p assumption as this site's Binomial Probability calculator — until a target number of successes r is reached, rather than stopping after a fixed number of trials. The probability the r-th success lands exactly on trial n is P(N = n) = C(n − 1, r − 1) × p^r × (1 − p)^(n − r): trial n itself must be a success, and the other r − 1 successes can fall anywhere among the preceding n − 1 trials, which is what the binomial coefficient counts.

Setting the target successes r to 1 reduces this exactly to the geometric distribution — the trial number of the first success. The expected (mean) trial number for the r-th success to occur is r ÷ p, and its variance is r × (1 − p) ÷ p², both standard closed-form results. This is distinct from the site's Binomial Probability calculator, which fixes the number of trials and asks about the number of successes — negative binomial flips that around, fixing the number of successes and asking about the number of trials.

FAQ

How is this different from the Binomial Probability calculator?

Binomial probability fixes the number of trials n and asks for the probability of getting some number of successes k within them. Negative binomial does the reverse: it fixes the target number of successes r and asks for the probability that reaching it takes some number of trials n. Both share the same per-trial, fixed-probability-p assumption — they're just asking the question from opposite ends.

What does "at least n trials" mean here?

It's the probability that the r-th success hasn't happened yet by trial n − 1 — in other words, it includes trial n itself as well as every later trial. Combined with "at most n" (the r-th success has already happened by trial n), these are complementary the same way they are for this site's other distribution calculators: at-most(n) and at-least(n+1) always sum to exactly 1.

Related calculators