Skip to main content
Examonaut

Topic 3 · Lesson 2 of 3

The negative binomial distribution

Probabilities

Let XX be the number of trials up to and including the rrth success. X=xX = x means the xxth trial is a success and exactly r−1r - 1 of the first x−1x - 1 trials were successes. The number of ways to place those is (x−1r−1)\binom{x - 1}{r - 1}, so

P(X=x)=(x−1r−1)pr(1−p)x−r,x=r,r+1,r+2,…\text{P}(X = x) = \binom{x - 1}{r - 1}p^r(1 - p)^{x - r}, \quad x = r, r + 1, r + 2, \ldots

We write X∼NB(r,p)X \sim \text{NB}(r, p). The smallest possible value is rr (every trial a success), with probability prp^r. With r=1r = 1 this is the geometric distribution.

The coefficient is (x−1r−1)\binom{x - 1}{r - 1}, not (xr)\binom{x}{r}: the last trial is fixed as a success, so only the earlier ones can be arranged.

Worked example

Free throws

A basketball player scores each free throw with probability 0.7. Find the probability that his third score comes from his fifth throw.

Show solution

Exactly 2 scores in the first 4 throws, then a score:

(42)(0.7)2(0.3)2×0.7=(42)(0.7)3(0.3)2=0.1852\binom{4}{2}(0.7)^2(0.3)^2 \times 0.7 = \binom{4}{2}(0.7)^3(0.3)^2 = 0.1852

Mean and variance

If X∼NB(r,p)X \sim \text{NB}(r, p) then

E(X)=rpVar(X)=r(1−p)p2\text{E}(X) = \frac{r}{p} \qquad \text{Var}(X) = \frac{r(1 - p)}{p^2}

Both are rr times the geometric values. This is no coincidence: the wait for the rrth success is the wait for the first, plus the wait from the first to the second, and so on. These rr waits are independent geometric variables, so

X=X1+X2+⋯+Xr,Xi∼Geo(p)X = X_1 + X_2 + \cdots + X_r, \quad X_i \sim \text{Geo}(p)

and means and variances of independent variables add.

Given a mean and a variance you can find both parameters: if the mean is 6 and the variance 6, dividing gives 1−pp=1\frac{1 - p}{p} = 1, so p=0.5p = 0.5, and then r=6p=3r = 6p = 3.

"The rrth success happens on or before trial nn" is the same event as "there are at least rr successes in the first nn trials". So if X∼NB(r,p)X \sim \text{NB}(r, p) and Y∼B(n,p)Y \sim \text{B}(n, p),

P(X⩽n)=P(Y⩾r)P(X>n)=P(Y⩽r−1)\text{P}(X \leqslant n) = \text{P}(Y \geqslant r) \qquad \text{P}(X > n) = \text{P}(Y \leqslant r - 1)

This turns a long sum of negative binomial terms into one binomial calculation on your calculator.

Worked example

Collecting stickers

One magazine in 4 contains a rare sticker, and a collector needs 2 of them. X∼NB(2,0.25)X \sim \text{NB}(2, 0.25).

Show solution
  • Mean 20.25=8\frac{2}{0.25} = 8 magazines; variance 2×0.750.0625=24\frac{2 \times 0.75}{0.0625} = 24, so standard deviation 4.90.
  • Exactly 8 magazines: (71)(0.25)2(0.75)6=0.0779\binom{7}{1}(0.25)^2(0.75)^6 = 0.0779.
  • More than 10 magazines: at most 1 sticker in 10 magazines, P(W⩽1)\text{P}(W \leqslant 1) with W∼B(10,0.25)W \sim \text{B}(10, 0.25), which is 0.24400.2440.

Worked example

The most likely number of trials

For X∼NB(3,0.5)X \sim \text{NB}(3, 0.5), which value of XX is most likely?

Show solution

Compare consecutive probabilities. With r=3r = 3 and p=0.5p = 0.5,

P(X=x+1)P(X=x)=(x2)(x−12)×0.5=xx−2×0.5\frac{\text{P}(X = x + 1)}{\text{P}(X = x)} = \frac{\binom{x}{2}}{\binom{x - 1}{2}} \times 0.5 = \frac{x}{x - 2} \times 0.5

This is greater than 1 when x<4x < 4, equal to 1 when x=4x = 4 and less than 1 when x>4x > 4. So the probabilities rise to P(X=4)=P(X=5)=316\text{P}(X = 4) = \text{P}(X = 5) = \frac{3}{16} and then fall: XX has two modes, 4 and 5. Unlike the geometric distribution, a negative binomial distribution with r>1r > 1 need not have its mode at the smallest value.

Choosing the right distribution

  • Fixed number of trials, counting successes: binomial.
  • Counting trials until the first success: geometric.
  • Counting trials until the rrth success: negative binomial.
  • Counting events in an interval, with no fixed number of trials: Poisson.

Read the question for what is fixed and what is counted.

Practise this topic

Both are part of Premium.