How long until the rth success — and which of the two definitions you are using.
Waiting for the rth success
P(exactly 5 failures)
0.104509
10.4509% — reaching 3 successes at p = 0.4000
The same k, read the other way, gives 0.138240. Under this page’s current setting k = 5 means failures; under the other convention it means total trials, which is 3 places along the same distribution. The two answers differ by 24.4%. Neither is wrong — but a textbook, a spreadsheet and a statistics package can each pick a different side without saying so, and this is where the disagreement comes from.
Mean failures
4.5000
Mean total trials
7.5000
Variance
11.2500
Variance ÷ mean
2.5000
Always overdispersed, by exactly 1/p. The variance divided by the mean is 2.5000, which is 1/p = 2.5000— not a coincidence of these inputs but an identity that holds for every r and p. A Poisson has variance equal to its mean, a ratio of exactly 1. Since p < 1 makes 1/p > 1, a negative binomial is always more spread out than the Poisson with the same average. That single fact is why count data with more variability than a Poisson allows gets modelled with this distribution instead.
What this tool shows
Two definitions share this name. One counts the failures before the rth success; the other counts total trials. They differ by exactly r, so the same k gives two different probabilities — and textbooks, spreadsheets and statistics packages each pick a side silently. This shows both.
Probability of exactly, at most, or at least k
Both the failures and total-trials conventions
The other convention’s answer, side by side
Mean, variance and the dispersion ratio
Why the variance is always mean ÷ p
When to use it instead of a Poisson
Both conventions Waiting-time counts Overdispersion shown Exact log-space maths
At r = 3, p = 0.4, k = 5 the two conventions give 0.1045 and 0.1382.
Updated 8 September 2026 · Works in any browser, no installation
It answers “how long until I get r successes?” A binomial fixes the number of trials and asks how many succeed. This fixes the number of successes and asks how many trials that takes — the same experiment with the question reversed.
At a glance
Formula shown
Failures convention: P(K = k) = C(k + r − 1, k) · p^r · (1 − p)^k, mean r(1 − p)/p. Trials convention: P(N = n) = C(n − 1, r − 1) · p^r · (1 − p)^(n − r), mean r/p. The two means differ by exactly r. Variance is r(1 − p)/p² either way, so variance ÷ mean = 1/p.
Scenario support
Sales calls until the third sale; interviews until two offers; defective items before a run of good ones; overdispersed count data in insurance claims, disease incidence and accident counts; sequencing read depth in genomics.
Educational estimate
Planning support from the values you enter — not professional advice.
Failures or trials — the answers differ by a third
This is not pedantry about notation. It changes the number.
Convention A counts failures. K is how many failures occur before the rth success arrives. K starts at 0 — you might succeed r times immediately. Its mean is r(1 − p)/p.
Convention B counts trials. N is the total number of attempts, successes included. N starts at r — you cannot get r successes in fewer than r attempts. Its mean is r/p.
N = K + r, exactly. Same distribution, shifted along by r, and every number that follows inherits the shift. At r = 3 and p = 0.4, the mean is 4.5 failures or 7.5 trials. Both are correct and they differ by 3.
The damage happens when someone types 5 into a calculator that means the other thing. At r = 3 and p = 0.4, P(exactly 5 failures) = 0.1045 while P(exactly 5 trials) = 0.1382 — the same keystroke, a 32% difference. The tool prints the other convention’s answer next to yours so the gap is visible rather than silent.
Which does your software use? R and SciPy count failures. Excel’s NEGBINOM.DIST also counts failures. Many textbooks — and most exam questions phrased as “the probability that the third success occurs on the eighth trial” — count trials. If you are checking your work against a package and are out by a factor near 1.3, this is almost always why.
The binomial with the question turned around
The two distributions describe identical experiments and differ only in what is fixed and what is random.
Binomial: fix 20 sales calls, ask how many sales. The trial count is known; the success count is random and bounded by it.
Negative binomial: fix 3 sales, ask how many calls. The success count is known; the trial count is random and unbounded — it might take 3 calls, it might take 300.
That unboundedness is the practical difference. A binomial cannot exceed n. A negative binomial has no upper limit, only a decreasing probability, which is exactly right for a “keep going until” process where you genuinely might be unlucky for a long time.
The special case r = 1 is the geometric distribution — how long until the first success. The negative binomial is what you get by adding r independent geometrics, which is also the cleanest way to see why its mean is r/p: each success costs 1/p trials on average, and you need r of them.
The convention split follows it there, and this is a good place to watch it operate. The geometric is almost always written in trials, and the negative binomial almost always in failures — so at r = 1 the two line up one place apart rather than exactly. At p = 0.3, the negative binomial gives 0.0504 for k = 5 and the geometric gives 0.0720 for the same k; they agree only once you shift by r = 1. Two functions in the same library can disagree this way, and ours do — which is why the verification suite asserts the offset rather than an equality.
The name is unfortunate. “Negative” refers to a binomial coefficient with a negative upper argument in the algebra behind the formula, not to anything negative in the outcomes — the counts are all non-negative.
Why count data outgrows the Poisson
The negative binomial’s second life has nothing to do with waiting times. It is the standard repair for count data that a Poisson cannot stretch to fit.
A Poisson forces variance = mean. That is not a convenience, it is a structural property, and real count data violates it constantly. Insurance claims per policyholder, hospital admissions per patient, accidents per driver, reads per gene — all show more spread than their mean allows.
The negative binomial’s variance is mean ÷ p, and since p < 1 that ratio always exceeds 1. It has a second parameter free to absorb exactly the excess variability the Poisson has no room for. The tool prints the ratio so you can see it move as p changes.
The mechanism is worth knowing, because it tells you when the fix is appropriate. If each unit has its own Poisson rate, and those rates vary across units following a gamma distribution, then the pooled counts are exactly negative binomial. Overdispersion is therefore usually a signature of unmodelled heterogeneity: your population is not one process but many with different rates.
The practical consequence is about standard errors, not point estimates. Fitting a Poisson to overdispersed data usually gets the mean roughly right and the uncertainty badly wrong — standard errors come out too small, confidence intervals too narrow, and p-values too significant. The coefficients look fine while the inference is not, which is why the error survives review.
Reading the shape
The distribution changes character with r, and the shape tells you how the process behaves.
At r = 1 it is strictly decreasing. Zero failures is the single most likely outcome, no matter how small p is. A one-in-a-hundred event is still likelier to arrive on the first attempt than on any other specific attempt — counter-intuitive, and true.
As r grows a peak appears and moves right, and the distribution becomes progressively more symmetric. This is the central limit theorem at work on the sum of r geometrics; by r = 20 or so a normal approximation is usable in the body, though the right tail stays heavier.
The right tail is long at small p, and this is the part worth planning around. At p = 0.1 and r = 3, the mean is 30 trials, but the distribution is skewed enough that a run of 60 is unremarkable. Budgeting for the mean of a heavily skewed waiting time is how projects run late: the average is not the typical experience, and it is certainly not a safe commitment.
Independence is the assumption that fails first. Sales calls after a rejection are not independent of it — the caller is discouraged, the list is stale, the market moved. If p drifts as you go, no single-p distribution describes the process, and the tail will be heavier than any r and p can reproduce.
Where it earns its place
Two distinct families of use, and it is worth being clear which one you are in.
Genuine waiting problems. How many prospects to contact for three sales; how many candidates to interview for two hires; how many units to inspect before finding the fifth defect. Here r and p are meaningful quantities you can name.
Overdispersed count regression. Claims per policy, incidents per site, RNA-seq read counts. Here r is a dispersion parameter with no waiting-time interpretation at all — it is fitted, and often not even an integer, which the mathematics permits because the binomial coefficient generalises through the gamma function.
Where it does not belong: a fixed number of trials (use the binomial), sampling without replacement from a small population (use the hypergeometric), or count data whose variance genuinely matches its mean (a Poisson is simpler and no worse).
One diagnostic that settles the Poisson question quickly: compute the sample variance and the sample mean of your counts. If the ratio is near 1, keep the Poisson. If it is 2 or 3, the negative binomial is doing real work rather than adding a parameter for its own sake.
Sources and methodology
References for both parameterisations and the overdispersion result.
Method. Probabilities are computed in log space — log binomial coefficient plus r⋅log p plus k⋅log(1 − p), exponentiated once at the end — so large r and small p do not overflow the coefficient before the small probability factors bring it back down. The convention toggle shifts k by exactly r rather than recomputing, which is why both answers come from one distribution. The suite asserts that the two conventions’ means differ by exactly r, that variance divided by mean equals 1/p across a grid of parameters, and that r = 1 lines up with the geometric distribution one place along — not term for term, because the geometric is conventionally written in trials and this in failures. That last assertion is deliberately stated as an offset rather than an equality: writing it as an equality would have encoded the very confusion this page is about. That engine is verified on every change against 219 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Geometric DistributionWaiting until the first success, with both conventions shown — and a panel that computes your remaining wait given past failures and from scratch, proving they are identical. The gambler's fallacy as arithmetic.
Poisson DistributionPoisson probabilities with a dispersion test against your own variance — because a Poisson forces variance to equal the mean, and real count data usually does not, which is exactly where the tail goes wrong.
Binomial DistributionExact binomial probabilities at any n — including thousands, where a factorial overflows — with the normal approximation beside them and its error measured, which is 0.6% at the centre and 261% in the tail.
Hypergeometric DistributionExact probabilities for drawing without replacement, with the binomial answer beside them and the 10% rule evaluated — at a 40% sampling fraction the binomial is 22% wrong, at 0.2% it is 0.06% wrong.
ProbabilityTwo events, repeated trials and Bayes, with the three usual errors handled — the dropped overlap in P(A or B), n×p instead of the complement, and the base rate that makes a 99% test 17% right.
Normal DistributionProbabilities under a normal curve in all four directions with the region shaded — and the empirical rule given exactly, because two standard deviations is 95.45% and the 95% everyone quotes sits at 1.96σ.
An educational tool. Results assume independent trials with a constant success probability; if p drifts as the process runs, the real right tail will be heavier than any single r and p can reproduce.
Published a negative binomial calculator that shows both conventions at once. Counting failures before the rth success and counting total trials differ by exactly r, so the same k gives 0.1045 or 0.1382 at r = 3 and p = 0.4 — and textbooks, spreadsheets and statistics packages each pick a side without saying so.
The verification suite found the same split inside this site's own library: geometricPmf counts trials while negBinomialPmf counts failures, so r = 1 lines up one place along rather than term for term. That is asserted as an offset, because writing it as an equality would have encoded the confusion the page is about.
Prints the variance divided by the mean, which is 1/p identically — the reason overdispersed count data gets modelled with this distribution instead of a Poisson.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.