Negative binomial distribution Created 2026-09-24 Updated 2026-10-20
The negative binomial distribution counts failures before a target number of successes in successive independent Bernoulli trials with constant success probability . In this stopping model, is a positive integer and . On the failures-before-the-th-success convention, the random variable takes values ; for , its probability mass function is
The binomial coefficient counts possible arrangements before the final success, as explained by the negative binomial stopping argument. At , every trial succeeds: with probability one, so its expected value and variance are both zero. This handles the endpoint without needing to interpret . At , the target is never reached and there is no proper finite waiting-count law.
For a worked example, toss a fair coin until the second head, calling heads and tails . Thus and . Exactly two failures means that the second success is on trial four. The complete stopped sequences are , and ; each has probability , giving . The first three masses are
Both and are modes, each with mass : there is no unique mode here. Later masses decrease, since for .
Figure 1.
Exactly two failures before the second success: three stopped sequences, each of probability 1/16
. Details.
The expected value and variance of the failures count are
If instead counts all trials, including the successes, then and
For the fair-coin example, , , and . Shifting the count changes its expected value but preserves its variance. When , has the failures-count geometric distribution, while has the all-trials geometric distribution. The two conventions and the moments are treated in Kyle Siegrist, The Negative Binomial Distribution, Random Services.
Figure 2.
Negative binomial failure counts for success probability 1/2 and targets of one, two and five successes
. Details.
The negative binomial distribution is useful when a procedure runs until it collects a target number of successes: for example, obtaining usable samples from independent attempts with a stable acceptance probability. A binomial distribution instead counts successes in a fixed number of trials. The attractive connection is that these two experimental questions can be answered from the same trial sequence, using the negative binomial stopping argument. For the failures count and , the positive mean satisfies , so the law allows overdispersion relative to a Poisson distribution. At , both quantities vanish and the inequality is not strict. The separate Poisson-gamma mixture explains another way this count law arises; its noninteger shape parameters do not represent a literal target number of successes.
For a finite stopping time with target , necessarily . The last toss must be a head and the preceding tosses must contain heads. The negative binomial stopping argument therefore gives likelihood for the biased coin, and for the fair coin. Applying Bayes' theorem again yields
The two experiments have different combinatorial coefficients, but each coefficient is independent of the coin parameter. Thus posterior equality for proportional likelihoods explains their identical posterior formula. If , a finite positive-head stopping observation has zero likelihood under the biased coin, consistently giving posterior zero. If the target is , the experiment stops at without a toss and the posterior remains ; a positive stopping time would then be impossible.
For , the last flip must be the th head. Among the preceding flips, exactly are tails and are heads. There are choices for their positions, and every resulting sequence has probability . The negative binomial stopping argument therefore gives
so has the failures-before-the-th-success negative binomial distribution.
To put the mass function into exponential family form, set
Since ,
where
Thus the natural parameter of an exponential family is , and the Fisher-Neyman factorization theorem shows that is a sufficient statistic. This is the negative binomial exponential family.
The exponential-family derivative identities now give
and
For the last chocolate to be taken on choice , the first choices must include exactly chocolate choices, and choice must take chocolate. Before that final success there is still chocolate available, so no forced plain choice has yet occurred. The negative binomial stopping argument gives
This is the all-trials convention of the negative binomial distribution. The finite examination scenario also has a remaining probability that the tray still contains chocolate after all choices; the displayed probabilities need not sum to one over . At the last chocolate is never taken, and at it is taken on choice .
First take . The forward object reaches at its th move, while the reverse object reaches that label at its th move. If the forward object wins after reverse moves, then . The final choice is forward; among the preceding choices, exactly are reverse. By the negative binomial stopping argument, this case has probability .
Sum these mutually exclusive cases and equate the result to part (e), using parts (b) and (d). This proves the success-failure stopping identity here:
The right side splits the same race into a special meeting at and all meetings beyond ; the left side splits it according to the number of reverse moves at the winning time.
At , both sides are zero with an empty sum and . At , the event has probability one; the right side equals . The printed left side includes and is outside the usual nonnegative-upper-index combinatorial definition. With the explicit generalized convention , its term is one and all terms vanish, so the identity also holds at that endpoint. Without this convention the displayed sum is undefined there; the zero-target race must instead be stated separately. All identities extend to by their polynomial forms.
Use the usual model of independent games, each with Sheila-win probability . After games, an outcome with wins and losses has possible orders. Since both totals are below eleven, none of those sequences has already ended the match. Thus
For a completed Sheila win with losses, the last game must be her eleventh win. The preceding games contain ten wins and losses, so their probability is , followed by one further factor . The allowed loss counts are , and these terminal events are disjoint. Hence
This is the match win probability with a fixed winning score, obtained by the negative binomial stopping argument. Constant marginal game-win probabilities alone would not justify the product without the usual independence assumption.
To obtain the st head on toss , the first tosses must contain exactly heads, and the last toss must be a head. There are choices of the first head positions. By independence, each such arrangement followed by a head has probability . The arrangements are disjoint, so
This is the negative binomial stopping argument, with counting all tosses up to and including the st success. It is not merely the probability of heads somewhere among tosses: the last toss is prescribed to be a head.
Success-failure stopping identity Created 2026-10-18 Updated 2026-10-20
In independent Bernoulli trials with success probability and failure probability , let be the trial of success and the trial of failure , for positive integers . If success occurs after failures, its final trial is a success and the preceding trials have successes and failures. The negative binomial stopping argument therefore gives the title sum.
Put . By trial , at least one target must have been reached, so the same event is that a binomial distribution with trials has at least successes. Conditioning instead on the final trial of a block of trials gives
Indeed, more than successes in the full block guarantee the success target won; with exactly successes it won only when the final trial was a failure. These disjoint cases explain the extra boundary term. A zero success target wins immediately; a zero failure target has already been reached. To include in the displayed finite sum requires the explicit generalized convention ; an upper summation limit of denotes an empty sum.