How Probability Models the Number of Attempts Needed to Reach Several Successes

Introduction

When an event can succeed or fail on each attempt, probability can describe how long it may take to reach a chosen number of successes. The key model is the negative binomial distribution: it gives the probability that the required success occurs on a particular attempt. It also helps calculate the average number of attempts and describe how much the total can vary.

The basic idea: count attempts until a target is reached

Suppose a process consists of repeated attempts, and each attempt has two possible outcomes: success or failure. If the aim is to obtain a fixed number of successes, the total number of attempts is not fixed. It depends on how many failures occur along the way.

For example, imagine a quality check in which each item independently passes with probability 0.8. If a worker continues until five items have passed, the total number checked could be five, six, seven, or more. The negative binomial distribution assigns probabilities to those possible totals.

In this setting, a success means the outcome of interest, not necessarily something desirable in everyday language. It might be a machine part meeting a specification, a customer responding to a survey, or a seed germinating. The model is mathematical and can describe any two-outcome process that meets its assumptions.

When the negative binomial model applies

The standard model relies on a few conditions. The number of successes to be reached is set in advance, and attempts continue until that target is met. Each attempt has the same probability of success, usually written as p, and outcomes on separate attempts are independent.

Independence means that the result of one attempt does not change the probability of success on the next. A constant success probability means that the process does not become systematically easier or harder as attempts continue. These conditions fit some situations well, but not all. If attempts influence one another, or the success rate changes over time, a different model may be needed.

Let r be the required number of successes, and let N be the total number of attempts made when the rth success occurs. The possible values of N begin at r, because at least one attempt is needed for each success.

The probability of reaching the target on a particular attempt

To find the probability that the target is reached on attempt n, the first n − 1 attempts must contain exactly r − 1 successes. Attempt n must then be a success. That final success brings the total to exactly r.

The formula is:

P(N = n) = C(n − 1, r − 1) × pr × (1 − p)n − r

Here, P(N = n) means the probability that the target is reached on attempt n. The symbol C(n − 1, r − 1) counts the ways to place the first r − 1 successes among the first n − 1 attempts. The factor pr accounts for all r successes, while (1 − p)n − r accounts for the failures. The formula applies when n is at least r.

The binomial coefficient matters because the earlier successes and failures can occur in different orders. The final attempt is always a success, but the preceding attempts can have many arrangements that lead to the same total.

A worked example

Suppose each attempt succeeds with probability 0.6, and the goal is three successes. What is the probability of reaching the third success on the fifth attempt?

For that to happen, the first four attempts must contain exactly two successes and two failures, in any order, and the fifth attempt must succeed. There are six ways to arrange two successes among the first four attempts. Therefore:

P(N = 5) = C(4, 2) × 0.63 × 0.42 = 0.20736

So the probability is about 0.207, or 20.7 percent. This is the probability of reaching the third success specifically on attempt five. It is not the probability of reaching the target by attempt five; that broader question includes reaching it on attempts three, four, or five.

Expected attempts and variation

The expected number of attempts is the long-run average predicted by the model:

E(N) = r / p

If success has probability 0.6 and the target is three successes, the expected total is 3 ÷ 0.6 = 5 attempts. This does not mean that five attempts are guaranteed, or that every group of attempts will average exactly five. Some runs will finish sooner, and others will take longer.

The variance, which measures spread around the mean, is:

Var(N) = r(1 − p) / p2

A larger variance means that totals are more spread out. When success is relatively unlikely, failures are more common and the total number of attempts can vary substantially. When success is nearly certain, the total tends to stay closer to the minimum of r attempts.

The expected value is useful for planning, but it is not a prediction of a particular run. For instance, a process with an average of ten attempts might sometimes finish in fewer than ten and sometimes require more. To understand the chance of finishing within a limit, use cumulative probabilities instead.

Probability of finishing by a deadline

If the question is whether the target will be reached within m attempts, add the probabilities of reaching it on each possible attempt from r through m:

P(N ≤ m) = Σ P(N = n), for n = r through m

This is called a cumulative probability. It answers questions such as, “What is the chance of obtaining four successful checks within six attempts?” The complementary probability, P(N > m), is the chance that the target has not yet been reached after m attempts.

These calculations are useful when a process has a time or resource limit. They can help describe the likelihood of completing a task within a set number of tries, provided the assumptions of the model are reasonable. A mean alone cannot answer this question, because it does not show the full distribution of possible totals.

Counting failures instead of total attempts

The same process can be described by counting failures before the target success. Let F be the number of failures before the rth success. Since every attempt is either a success or a failure, total attempts and failures are related by N = r + F.

This version of the negative binomial distribution is often used in textbooks and software. Its probability formula is:

P(F = k) = C(k + r − 1, r − 1) × pr × (1 − p)k

Here, k is the number of failures before the target is reached. The average number of failures is r(1 − p) / p. Adding the fixed r successes gives an average total of r / p attempts, as before.

Because sources may define the random variable differently, it is worth checking whether a stated negative binomial model counts total attempts or failures. The probability calculations are equivalent, but the values are shifted by the number of required successes.

How it relates to the geometric distribution

The geometric distribution is the special case in which the target is one success. It models the number of attempts needed to get the first success. The negative binomial distribution extends that idea to a target of two or more successes.

For example, if a sensor has a 0.9 probability of recording a valid reading each time it is used, the geometric model can describe attempts until the first valid reading. If the goal is to collect several valid readings, the negative binomial model can describe the total attempts instead.

Common interpretation mistakes

Confusing “exactly on” with “by.” The probability of reaching a target on attempt six is one value from the distribution. The probability of reaching it by attempt six combines all the relevant earlier values as well.

Treating the average as a guarantee. An expected number of attempts summarizes many hypothetical repetitions. It does not determine when an individual sequence will end.

Ignoring the assumptions. If success probabilities differ between attempts, or outcomes are dependent, the standard formula may not describe the process accurately. For example, learning, fatigue, changing conditions, or sampling without replacement can affect the probability structure.

Mixing up successes and failures. The target is usually stated as a number of successes, but some formulas count the failures before that target. Identifying the variable and its definition prevents off-by-r errors.

Where the model is useful

The negative binomial distribution is used wherever repeated independent trials continue until a fixed number of successes occurs. In manufacturing, it can represent checks needed to find a set number of acceptable items when each item has a stable pass probability. In ecology, a simplified version can describe sampling effort needed to observe a set number of occurrences, if the assumptions suit the study.

It also appears in reliability analysis, quality control, and planning repeated tests. In each case, the model provides a structured way to connect a success rate with the number of attempts needed. Real-world data may require adjustments, especially when the success rate varies or when observations are grouped or dependent.

There is also a related use of the negative binomial distribution in statistics for modeling count data that show more variation than a basic Poisson model allows. That application has a different setup: it models counts within a fixed observation period rather than simply counting attempts until a fixed number of successes. The shared name reflects a mathematical relationship, but the interpretation should be checked from context.

Conclusion

The negative binomial distribution models the total attempts required to reach a fixed number of successes when each attempt has the same success probability and attempts are independent. Its formula gives the chance of reaching the target on a particular attempt; its mean gives the long-run average, while cumulative probabilities answer deadline questions. Understanding what is counted—and whether the assumptions fit the process—makes the model far more useful.