Why Geometric Waiting Times Add to a Negative Binomial
Suppose a quality-control test is repeated until a fixed number of items pass. The number of tests required to obtain one passing item has a geometric distribution. If the tests are independent and the chance of passing stays constant, the total number of tests required to obtain several passing items is a sum of independent geometric waiting times. That sum has a negative binomial distribution.
The key is to be precise about what is being counted. In this tutorial, the random variable counts all trials through and including the trial on which the required success occurs. This convention gives a minimum total of \(r\) trials when \(r\) successes are required. The result is aligned with the SOA VEE Mathematical Statistics syllabus.
Write \(q=1-p\) for the probability of failure on any one trial. The common-\(p\) condition means that every waiting time describes the same success probability. Independence means that the trial outcomes do not affect one another; in particular, one success does not change the chance of success on the next trial.
The Negative Binomial Probability Formula
For the \(r\)th success to occur on trial \(n\), trial \(n\) must be a success, and exactly \(r-1\) of the first \(n-1\) trials must be successes. The other \(n-r\) trials are failures. There are \(\binom{n-1}{r-1}\) ways to choose which of the first \(n-1\) trials are successes. Each such sequence has probability \(p^r q^{n-r}\).
The formula can also be obtained from the convolution of the geometric waiting times. For example, when \(r=2\), the total \(N=n\) can arise from \(X_1=k\) and \(X_2=n-k\), for \(k=1,\ldots,n-1\). Each pair has probability \(p^2q^{n-2}\), so summing the \(n-1\) possibilities gives \(P(N=n)=(n-1)p^2q^{n-2}\). For general \(r\), the number of ways to divide the \(n-r\) failures among the \(r\) waiting periods is \(\binom{n-1}{r-1}\), yielding the same formula.
For \(N=n\), the \(r\)th success must occur on trial \(n\), so that trial is a success.
The first \(n-1\) trials must contain exactly \(r-1\) successes. There are \(\binom{n-1}{r-1}\) possible sets of success positions.
Every allowed sequence has \(r\) successes and \(n-r\) failures, so independence gives probability \(p^rq^{n-r}\). Multiplying by the number of sequences gives the formula.
A useful check is the support: the total cannot be less than \(r\), because each success requires at least one trial. At \(n=r\), every trial must be a success, and the formula gives \(P(N=r)=p^r\), as it should.
Worked Probability Calculations
Worked Example: Three Passing Items by the Fifth Test
A hypothetical inspection process tests items one at a time. Assume each test is independent and an item passes with probability \(p=0.4\). Let \(N\) be the number of tests through the third passing item. Find the probability that the third passing item is obtained on test 5.
Method. This is an exact trial-count probability with \(r=3\), \(n=5\), \(p=0.4\), and \(q=1-0.4=0.6\). The fifth test must be a pass, and exactly two of the first four tests must be passes.
There are \(\binom{4}{2}=6\) ways to place the two earlier passes. Also, \((0.4)^3=0.064\) and \((0.6)^2=0.36\). Therefore,
To four decimal places, the probability is 0.1382. As a check, each of the six qualifying sequences has three passes and two failures, so each has probability \(0.4^3(0.6)^2=0.02304\); their total is \(6(0.02304)=0.13824\). A common mistake would be to use \(\binom{5}{3}\), which allows the final test to be a failure. The final test must be the third success, so the choices are made only among the first four tests.
Worked Example: Exactly Six Tests Versus At Most Six
A hypothetical screening procedure has an independent success probability of \(p=0.5\) on each trial. Let \(N\) count the trials through the fourth success. Find (a) \(P(N=6)\) and (b) \(P(N\leq 6)\).
(a) Exactly six trials. Here \(r=4\), \(n=6\), and \(q=0.5\). The first five trials must contain exactly three successes, followed by a success on trial 6:
Thus \(P(N=6)=0.1563\) to four decimal places.
(b) At most six trials. The fourth success must have occurred by trial 6 exactly when at least four successes occur in the first six trials. The possible success counts in those six trials are 4, 5, or 6:
Thus \(P(N\leq 6)=0.3438\) to four decimal places. The exact event \(N=6\) is only one part of the cumulative event \(N\leq6\), so the cumulative probability is larger, as the values confirm. Confusing these two events is a common exam trap.
Worked Example: Two Successes and a More-Than Trial Count
A hypothetical sensor detects a target independently on each scan with probability \(p=0.3\). Let \(N\) be the number of scans through the second detection. Find (a) \(P(N=7)\) and (b) \(P(N>7)\).
(a) Exactly seven scans. Here \(r=2\), \(n=7\), and \(q=0.7\). The seventh scan is a detection, and there is exactly one detection among the first six scans:
Since \((0.3)^2=0.09\), \((0.7)^5=0.16807\), and \(\binom{6}{1}=6\),
Therefore \(P(N=7)=0.0908\) to four decimal places.
(b) More than seven scans. This means fewer than two detections in the first seven scans: either zero detections or one detection. Those cases have probabilities \(0.7^7\) and \(\binom{7}{1}(0.3)(0.7)^6\), respectively:
Thus \(P(N>7)=0.3294\) to four decimal places. As a check on the event interpretation, \(N>7\) is the complement of obtaining at least two detections by scan 7; it is not the event of exactly one detection on scan 7.
Conventions, Assumptions, and Common Traps
The term “negative binomial” is used with more than one counting convention. Here \(N\) counts trials through the \(r\)th success, so its support begins at \(r\). Another convention counts only failures before the \(r\)th success; that random variable equals \(N-r\) and has support beginning at zero. The formulas describe equivalent events after translating the count, but their values of \(n\) differ by \(r\).
| Question wording | Event to calculate | Useful interpretation |
|---|---|---|
| The \(r\)th success is on trial \(n\) | \(P(N=n)\) | Exactly \(r-1\) successes in the first \(n-1\), then a success |
| The \(r\)th success occurs by trial \(m\) | \(P(N\leq m)\) | At least \(r\) successes in the first \(m\) trials |
| More than \(m\) trials are needed | \(P(N>m)\) | At most \(r-1\) successes in the first \(m\) trials |
Before using the formula, verify that trials are independent, the success probability is constant, and the waiting times are being added for a fixed number of successes. If the success probability changes between trials, or if a success changes later trial probabilities, the common-\(p\) negative binomial formula does not apply as stated. If \(p=1\), the total is deterministically \(r\); if \(p=0\), the required successes never occur.
- Using the wrong number of choices. For \(P(N=n)\), choose the \(r-1\) earlier successes from the first \(n-1\) trials, not from all \(n\). The last trial is already fixed as a success.
- Mixing up exact and cumulative probabilities. “On trial \(n\)” means one probability mass. “By trial \(n\)” includes several possible final trial counts.
- Switching counting conventions without adjusting. If a question counts failures rather than total trials, subtract \(r\) from the total-trial count before applying the corresponding formula.
Check Your Understanding
For each problem, use the convention that the count includes the success trial. Assume independence and a constant success probability whenever the problem specifies them.
- A device passes each independent test with probability \(0.25\). If \(N\) is the number of tests through the third pass, find \(P(N=5)\). (Answer: \(27/512=0.0527\) to four decimal places)
- A monitoring procedure has independent detection probability \(0.6\) per scan. If \(N\) counts scans through the second detection, find \(P(N\leq4)\). (Answer: \(0.8208\))
- An independent trial succeeds with probability \(0.5\). For the number of trials through the third success, find the probability that the third success occurs on trial 6. (Answer: \(10/64=0.1563\) to four decimal places)
- A hypothetical sensor has independent success probability \(0.2\) per reading. For the number of readings through the second success, find the probability that more than five readings are needed. (Answer: \(0.7373\) to four decimal places)
- A hypothetical assay gives an independent positive result with probability \(0.4\) on each test. Let \(N\) count tests through the fifth positive result. Find \(P(N=7)\). (Answer: \(0.0553\) to four decimal places)