Mathwords logoMathwords

Negative Binomial Distribution — Definition, Formula & Examples

The negative binomial distribution models the number of independent Bernoulli trials needed to achieve a specified number of successes. It answers questions like 'How many trials will it take to get my 5th success?'

Let XX be the number of trials required to obtain exactly rr successes in a sequence of independent Bernoulli trials, each with success probability pp. Then XX follows a negative binomial distribution with parameters rr and pp, and its probability mass function gives P(X=x)P(X = x) for x=r,r+1,r+2,x = r, r+1, r+2, \ldots

Key Formula

P(X=x)=(x1r1)pr(1p)xr,x=r,r+1,r+2,P(X = x) = \binom{x-1}{r-1} p^{r} (1-p)^{x-r}, \quad x = r, r+1, r+2, \ldots
Where:
  • xx = Total number of trials until the r-th success
  • rr = Desired number of successes (positive integer)
  • pp = Probability of success on each trial
  • (x1r1)\binom{x-1}{r-1} = Number of ways to place r − 1 successes in the first x − 1 trials

How It Works

You use the negative binomial distribution when you repeat an experiment with two outcomes (success or failure) and want to know the probability that the rr-th success occurs on exactly the xx-th trial. The last trial must be a success, so you choose how to arrange r1r - 1 successes among the first x1x - 1 trials, then multiply by the probability of the remaining failures and the final success. Note that some textbooks define the random variable as the number of failures before the rr-th success; always check which convention your course uses.

Worked Example

Problem: A free-throw shooter makes 80% of her shots. What is the probability that her 3rd made free throw occurs on exactly the 5th attempt?
Identify parameters: Here r = 3 successes, p = 0.8, and we want x = 5 total trials.
Compute the binomial coefficient: Choose where the first 2 successes fall among the first 4 trials.
(5131)=(42)=6\binom{5-1}{3-1} = \binom{4}{2} = 6
Apply the formula: Multiply the coefficient by the success and failure probabilities raised to the appropriate powers.
P(X=5)=6(0.8)3(0.2)2=60.5120.04=0.12288P(X=5) = 6 \cdot (0.8)^3 \cdot (0.2)^2 = 6 \cdot 0.512 \cdot 0.04 = 0.12288
Answer: The probability is approximately 0.1229, or about 12.3%.

Why It Matters

The negative binomial distribution appears in quality control (how many items must you inspect to find rr defectives?), clinical trials (how many patients until rr respond to treatment?), and ecology (modeling organism counts with overdispersion). It generalizes the geometric distribution, which is the special case r=1r = 1.

Common Mistakes

Mistake: Confusing it with the binomial distribution by fixing the number of trials instead of the number of successes.
Correction: The binomial fixes the number of trials and counts successes. The negative binomial fixes the number of successes and counts trials (or failures). Make sure you identify which quantity is predetermined.