Why Counting Sequences Gives the Probability
A waiting-time question asks not only how many successes occur, but when a specified success occurs. For example, the event that the third positive result occurs on sample 5 requires the fifth result to be positive, with exactly two positive results among the first four. Counting the possible orders of those first four results gives the number of ways the event can happen; the Bernoulli model gives the probability of each way.
The derivation depends on a fixed-trial model. Each trial has two possible outcomes, called success and failure, and its success probability is the same on every trial. The outcomes on different trials must also be independent. If the success probability changes over time or trials are dependent, the formula derived here generally does not apply.
A particular ordered sequence of \(n\) outcomes that qualifies for \(T_r=n\) has \(r\) successes and \(n-r\) failures. By independence, its probability is \(p^r q^{n-r}\). The remaining task is to count how many such sequences there are.
Deriving the Negative Binomial Mass Function
The last trial is already determined: it must be a success, because it is the \(r\)th success. Among the first \(n-1\) trials, choose the \(r-1\) positions occupied by successes. All other positions among those first \(n-1\) trials must be failures. Therefore the number of qualifying sequences is \(\binom{n-1}{r-1}\). The events corresponding to the different sequences are disjoint, and each has the same probability.
This is the probability mass function for the trial number of the \(r\)th success. Each part has a direct interpretation: the binomial coefficient counts arrangements before the final trial; \(p^r\) accounts for all \(r\) successes, including the required success on trial \(n\); and \(q^{n-r}\) accounts for the failures among the first \(n-1\) trials.
The exponents and the binomial coefficient can be checked from the event description. Across all \(n\) trials there are \(r\) successes and \(n-r\) failures. But only the first \(n-1\) positions are being arranged freely: the final success is fixed. Thus the count is not \(\binom{n}{r}\), which would count arrangements of \(r\) successes anywhere among \(n\) trials and would include sequences whose \(r\)th success happens before trial \(n\).
Worked Example: Third Positive Result on Sample 5
A hypothetical laboratory instrument records a positive result independently on each sample with probability \(p=0.40\). What is the probability that the third positive result occurs on sample 5? Also state how many ordered outcome sequences qualify.
Method. Use the exact-trial mass function. Here \(r=3\), \(n=5\), \(p=0.40\), and \(q=1-0.40=0.60\). The first four samples must contain exactly two positives, and sample 5 must be positive.
Count the sequences. Choose which two of the first four samples are positive. The remaining two of those samples are negative, and the fifth sample is the required third positive:
Probability of one sequence. Every qualifying sequence contains three positives and two negatives. By independence, its probability is
Combine the disjoint sequences.
There are 6 qualifying sequences, and the probability is 0.13824. As a check, each sequence ends in a positive and has exactly two positives among the first four; multiplying the common sequence probability by six gives the event probability. The common mistake avoided here is dropping or miscalculating the sequence probability after correctly finding the count.
Applying the Count to Different Success Probabilities
The counting method does not depend on what a success represents. It may be a part passing inspection, a transaction meeting a specified criterion, or a hypothetical observation being classified as positive. What matters is that the outcome on each trial follows the same independent Bernoulli model. Translate the event into the number of successes and failures first, then use the arrangement count.
Worked Example: Fourth Pass on Test 6
At a hypothetical quality-control station, each part passes independently with probability \(p=0.70\). Find the probability that the fourth pass occurs on test 6. State the number of failures in each qualifying sequence and the number of qualifying sequences.
Method. For the fourth pass to occur on test 6, test 6 must be a pass and the first five tests must contain exactly three passes. Thus \(r=4\), \(n=6\), and \(q=1-0.70=0.30\).
Count and identify outcomes. Choose three of the first five tests to be passes. The other two of the first five are failures; test 6 is the fourth pass. So each qualifying sequence has four passes and two failures, and there are
qualifying sequences.
Probability. One sequence has probability \((0.70)^4(0.30)^2\). Evaluating each factor,
Summing the probabilities of the 10 disjoint sequences gives
The answer is 10 sequences, 2 failures per sequence, and probability 0.21609. The sequence count is not itself the probability: the probability of one sequence must still be multiplied by the count. The check is that each sequence has six outcomes in total, four passes and two failures, as required.
Worked Example: Fifth Flag on Audit 9
In a hypothetical audit process, each reviewed record is independently flagged with probability \(p=0.20\). Find the probability that the fifth flagged record is found on review 9. Show both the count of arrangements and the probability calculation.
Method. The ninth review must be flagged, and the first eight reviews must contain exactly four flagged records. Thus \(r=5\), \(n=9\), and \(q=1-0.20=0.80\).
Count the arrangements. The four earlier flags can occupy any four of the first eight positions:
Each qualifying sequence therefore contains five flagged records and four unflagged records. Its probability is
Multiplying by the 70 disjoint arrangements,
The probability is 0.00917504, or about 0.0092 to four decimal places. The check is that the exponent of \(0.20\) is five, not four: the flagged record on review 9 is included among the five total flags. The common error this avoids is counting only the flags before the final review when setting the probability exponent.
Common Counting and Probability Traps
A reliable solution separates the event into its fixed last outcome, the arrangements before it, and the probability of one complete sequence. Most errors come from blending these steps or using a count that describes a different event.
- Choosing positions among all \(n\) trials. The last trial is required to be the \(r\)th success, so choose the earlier successes among the first \(n-1\) trials. Use \(\binom{n-1}{r-1}\), not \(\binom{n}{r}\).
- Using only \(r-1\) successes in the probability. There are \(r-1\) successes before trial \(n\), but trial \(n\) adds one more. A qualifying complete sequence has \(r\) successes, so its success factor is \(p^r\).
- Using the wrong failure count. The first \(n-1\) trials contain \(n-r\) failures, and trial \(n\) is a success. Hence the failure factor is \(q^{n-r}\).
- Forgetting the assumptions. The product \(p^r q^{n-r}\) applies when each trial is independent and has the same success probability \(p\). A changing success probability requires a different calculation.
- Allowing an impossible trial number. The \(r\)th success cannot occur before trial \(r\). If \(n<r\), then \(P(T_r=n)=0\).
Check Your Understanding
For each problem, identify the required arrangement count and use the probability of a complete qualifying sequence. Assume independent trials with the stated constant success probability.
- A sensor registers a target independently with probability \(0.50\) on each scan. Find the probability that the second registration occurs on scan 4. (Answer: \(0.1875\))
- A hypothetical screening procedure has a positive-result probability of \(0.60\) on each independent test. Find the probability that the third positive occurs on test 5. (Answer: \(0.20736\))
- A machine produces an acceptable unit with probability \(0.30\) on each independent attempt. Find the probability that the fourth acceptable unit occurs on attempt 7, and state the number of failures in a qualifying sequence. (Answer: \(0.055566\); 3 failures)
- In a hypothetical independent review process, each record is flagged with probability \(0.80\). Find the probability that the second flag occurs on review 5. (Answer: \(0.02048\))
- A process is observed for four independent trials, each with success probability \(0.25\). Can the third success occur on trial 2? Give the probability of that event and explain the support restriction. (Answer: \(0\); the third success cannot occur before trial 3)