Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find a Negative Binomial Probability

A negative binomial variable is the number of the trial on which the rrth success happens. That trial must be a success, and the other r−1r - 1 successes can sit anywhere among the trials before it, so you count those placements with (k−1r−1)\binom{k-1}{r-1}.

Recognize the task

Independent trials with the same success probability continue until a set number of successes is reached: "the third head", "a series won by the first team to 44 wins", "the 55th sale of the day". Test: the stopping rule is "rr successes" with r>1r > 1. With r=1r = 1 it is the geometric case. Then X∼NB⁡(r,p)X \sim \operatorname{NB}(r, p) with values k=r,r+1,…k = r, r + 1, \ldots
The model is defined in the negative binomial lesson; here XX counts trials, not failures.

Two ways to do it

PMF term by termexact trial
P(X=k)=(k−1r−1)pr(1−p)k−rP(X = k) = \binom{k-1}{r-1} p^r (1-p)^{k-r}
Use the negative binomial PMF for one value of kk; add terms for a short range.
Switch to a binomial countwithin k trials
P(X≤k)=P(Y≥r),Y∼Bin⁡(k,p)P(X \le k) = P(Y \ge r), \quad Y \sim \operatorname{Bin}(k, p)
"The rrth success by trial kk" is "at least rr successes in kk trials"; use binomial probability.

Steps

StepOn a fair coin, P(third head on toss 5)P(\text{third head on toss } 5)
1Name rr, pp and kk. rr is the number of successes you wait for, kk the trial on which the last of them happens. Check k≥rk \ge r.r=3r = 3, p=12p = \frac{1}{2}, k=5k = 5
2Fix the last trial as a success. Trial kk is the rrth success. Among the first k−1k - 1 trials there are exactly r−1r - 1 successes.22 heads among the first 44 tosses, then a head
3Count the placements and multiply. There are (k−1r−1)\binom{k-1}{r-1} ways to place the earlier successes; each arrangement has probability pr(1−p)k−rp^r (1-p)^{k-r}.(42)(12)3(12)2=632\binom{4}{2}\left(\frac{1}{2}\right)^3\left(\frac{1}{2}\right)^2 = \frac{6}{32}
4Simplify, or add terms for a range. For "within kk trials", add the terms from rr to kk or switch to the binomial count.P(X=5)=316=0.1875P(X = 5) = \frac{3}{16} = 0.1875

Worked examples

Example 1 · one exact trial

PMF
p=0.4p = 0.4, P(second success on trial 4)P(\text{second success on trial } 4)
r=2r = 2, k=4k = 4
(31)(0.4)2(0.6)2=3⋅0.16⋅0.36\binom{3}{1}(0.4)^2(0.6)^2 = 3 \cdot 0.16 \cdot 0.36
one earlier success in 33 trials
P(X=4)=0.1728P(X = 4) = 0.1728

Example 2 · within k trials

two ways
p=0.4p = 0.4, r=2r = 2, P(X≤4)P(X \le 4)
trials 2,3,42, 3, 4
0.16+0.192+0.1728=0.52480.16 + 0.192 + 0.1728 = 0.5248
P(X=2),P(X=3),P(X=4)P(X = 2), P(X = 3), P(X = 4)
1−(0.6)4−4(0.4)(0.6)3=1−0.1296−0.34561 - (0.6)^4 - 4(0.4)(0.6)^3 = 1 - 0.1296 - 0.3456
check: at least 22 in 44
P(X≤4)=0.5248P(X \le 4) = 0.5248
both routes agree

Example 3 · a best-of series

r = 3
first to 33 wins, p=0.6p = 0.6 per game, P(done in game 5)P(\text{done in game } 5)
the winner wins game 55
(42)(0.6)3(0.4)2=6⋅0.216⋅0.16\binom{4}{2}(0.6)^3(0.4)^2 = 6 \cdot 0.216 \cdot 0.16
22 wins in the first 44
P(X=5)=0.20736≈0.2074P(X = 5) = 0.20736 \approx 0.2074
for this team winning
The series also ends in game 55 when the other team wins it; add (42)(0.4)3(0.6)2\binom{4}{2}(0.4)^3(0.6)^2 for that case.
Check the terms in the discrete distributions calculator.

See it happen

Picture the kk trials as a row of boxes. The last box must hold a success, and the other r−1r - 1 successes are scattered over the k−1k - 1 boxes before it. Every scattering has the same probability, and (k−1r−1)\binom{k-1}{r-1} counts them. That is why the coefficient is not (kr)\binom{k}{r}: the last success is pinned. Watch the PMF move right as rr grows in the negative binomial visualizer.

Common mistakes

Using the binomial coefficient of all trials

✗ P(X=5)=(53)(12)5=1032P(X = 5) = \binom{5}{3}\left(\frac{1}{2}\right)^5 = \frac{10}{32}
✓ the last toss is fixed as a head: (42)(12)5=632\binom{4}{2}\left(\frac{1}{2}\right)^5 = \frac{6}{32}

Values below r

✗ P(X=2)P(X = 2) for r=3r = 3 computed with the formula
✓ three successes need at least three trials, so P(X=2)=0P(X = 2) = 0

Trials versus failures

✗ using (k−1r−1)\binom{k-1}{r-1} with kk = number of failures
✓ with YY failures before the rrth success, P(Y=y)=(y+r−1r−1)pr(1−p)yP(Y = y) = \binom{y+r-1}{r-1} p^r (1-p)^y and X=Y+rX = Y + r