An evaluation record that runs exactly five trials has a fixed sample size and a random success count. A record that stops as soon as it obtains three successes has the opposite structure: the success target is fixed, and the number of trials is random.

The second experiment leads to a negative-binomial stopping model under independent trials with an unchanged success probability. Confusing its number of failures with its total number of attempts shifts the result by the success target.

This article uses invented binary outcomes and a stipulated probability. It is not a retry policy for physical robot actions, a measured completion rate, or a recommendation to keep operating until a target is reached. No statistical library or hardware experiment was run.

Name both random counts

Assume each independent trial succeeds with probability p = 0.6 and fails with probability 0.4. Stop at the third success, so the fixed target is r = 3.

Let K count the failures that occur before that stopping success. Let T count all attempts, including the three successful ones. Then T = K+3. K can be zero, one, two, and so on; T can be three, four, five, and so on.

SciPy and R both document a negative-binomial convention that counts failures before the fixed success target. Their parameter names differ from some textbook notation, so the random quantity should be stated before copying a formula or interpreting an output.

Count histories that stop at one exact trial

For K = k, the final trial must succeed. Among the preceding k+r−1 trials, exactly r−1 must be successes and k must be failures. There are choose(k+r−1, r−1) possible positions for those earlier successes.

Each such complete history has probability p to the power r times (1−p) to the power k. Thus P(K=k) = choose(k+r−1, r−1)p^r(1−p)^k.

The forced final success matters. If the preceding sequence had already contained three successes, the experiment would have stopped earlier and would not belong to this event.

Build the first four probabilities

To finish at T = 3, all three trials must succeed. There is one history, SSS, with probability 0.6³ = 0.216. This corresponds to K = 0.

To finish at T = 4, exactly two of the first three trials must succeed and the fourth must succeed. There are choose(3,2) = 3 admissible histories, giving probability 3×0.6³×0.4 = 0.2592.

For T = 5, choose the two earlier successes among the first four positions. The probability is choose(4,2)×0.6³×0.4² = 0.20736. An example history is FSSFS; its third success occurs on the fifth trial.

For T = 6, the probability is choose(5,2)×0.6³×0.4³ = 0.13824. Summing these four mutually exclusive stopping times gives P(T≤6) = 0.8208.

The remaining probability, 0.1792, belongs to experiments that have not yet reached three successes by trial six. It is not a probability of exactly six failures.

Compare an exact stopping time with a fixed-window count

Let X be the number of successes in a separate fixed experiment of five trials. Exactly three successes has probability choose(5,3)×0.6³×0.4² = 0.3456.

That differs from P(T=5) = 0.20736. The fixed-window event allows the third success to occur before the fifth trial, followed by later failures. The stopping experiment does not continue to record those later outcomes.

For example, SSSFF has exactly three successes in five fixed trials, but its third success occurred on trial three. It therefore contributes to X=3 and T=3, rather than T=5.

The correct connection is P(T≤n) = P(X_n≥r), where X_n counts successes in n hypothetical independent trials with the same p. Reaching the target by n is equivalent to having accumulated at least r successes in that prefix.

At n = 5, the stopping-time sum is 0.216+0.2592+0.20736 = 0.68256. The binomial tail gives the same number: 0.3456 for three successes, 0.2592 for four, and 0.07776 for five.

Means retain the counting convention

The documented failures mean is E[K] = r(1−p)/p. Here it equals 3×0.4/0.6 = 2 failures. Adding the three successes gives E[T] = 5 attempts.

The variance of K is r(1−p)/p² = 10/3, approximately 3.333333. Adding a constant changes the mean but not variance, so T has the same variance in squared-attempt units.

An average of five attempts does not specify a probability of completion by five. The exact completion probability by that budget is 0.68256 under this model. A mean and a cumulative probability answer different questions.

Update the remaining target after a prefix

Suppose four trials have occurred and exactly two succeeded. Independence leaves future trial success probability at 0.6. Only one more success is needed, so expected additional attempts are 1/0.6, approximately 1.666667.

If those same four trials contained only one success, two remain necessary, and expected additional attempts are 2/0.6, approximately 3.333333. Elapsed trial count alone does not identify the remaining distribution; accumulated successes matter.

This distinguishes a multiple-success stopping problem from a simple countdown and from a continuous exponential lifetime model. The fixed success target creates state in the number still required.

Preserve the assumptions with the probabilities

At p = 1, T is exactly r and K is zero. At p = 0, the positive success target is never reached, so the finite-mean formulas do not apply. For intermediate p, the distribution has no fixed finite upper limit.

Independence and constant p are substantive model inputs. Learning, changing conditions, or dependence between outcomes require another model. Keep the success definition, target, stopping rule, counted variable, and trial assumptions with any reported trial-budget probability.

Sources checked October 24, 2026:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.nbinom.html — SciPy v1.18.0 Manual as accessed; independent Bernoulli stopping definition and failures-count probability formula read. No SciPy execution is claimed.

https://stat.ethz.ch/R-manual/R-devel/library/stats/html/NegBinomial.html — R stats 4.6.0 development manual as displayed; failures convention, mean, variance, and parameterization read. The article uses an integer success target, not the broader noninteger dispersion interpretation.

Illustration note: A generic robot and laptop workspace is a concept illustration. It does not show this invented example, measured robot performance, or an executed software test.