Tutorials › Exam P - Probability › Sums of Geometric and Negative Binomial Variables

Exam P · Sums of Independent Variables · Tutorial 823 of 915

Sums of Geometric and Negative Binomial Variables

Combine independent geometric and negative binomial counts correctly by checking independence, success probabilities, and what each variable counts.

Advanced 12 min read

What You'll Learn

  • Define geometric and negative binomial variables using the failures-before-success convention.
  • Identify the shared-success-probability and independence conditions for closure.
  • Derive the distribution of a sum by multiplying probability generating functions.
  • Calculate probabilities and moments for sums of geometric or negative binomial variables.
  • Convert trial-count variables into failure counts before adding them.
  • Recognize why different success probabilities do not generally give a negative binomial sum.

Why Counting Conventions Matter

A geometric random variable can count either the failures before a success or the number of trials through that success. These quantities differ by one. A negative binomial variable has a similar distinction: it may count failures before a specified success or total trials through that success. When adding such variables, a one-unit shift can change the support and every probability.

The useful closure result is precise: independent failure counts combine into a negative binomial count when they share the same success probability. The common probability and the counting convention must both be checked before applying the result.

Definition: A geometric random variable \(G\) with success probability \(p\), where \(0<p\leq 1\), counts the number of failures before the first success in independent Bernoulli trials. Write \(q=1-p\). Its support is \(0,1,2,\ldots\), and $$ P(G=k)=q^k p,\qquad k=0,1,2,\ldots. $$ A negative binomial random variable \(F_r\) counts the number of failures before the \(r\)th success, where \(r\) is a positive integer. Its support and probability mass function are $$ P(F_r=k)=\binom{k+r-1}{r-1}p^r q^k,\qquad k=0,1,2,\ldots. $$ Thus \(G\) is the special case \(F_1\). The number of trials through the \(r\)th success is \(F_r+r\), not \(F_r\).

These definitions assume repeated Bernoulli trials with a constant success probability \(p\), and independence from trial to trial. For sums of separate variables, the variables being added must also be independent. If the success probabilities differ, or the random variables are dependent, the closure result below cannot be used without further analysis.

The Closure Result and Why It Holds

Theorem: Let \(F_{r_1},\ldots,F_{r_m}\) be independent negative binomial variables, each counting failures before its specified number \(r_j\) of successes. If all have the same success probability \(p\), then $$ F_{r_1}+\cdots+F_{r_m}\sim F_{r_1+\cdots+r_m}. $$ In particular, a sum of \(m\) independent geometric variables with common success probability \(p\) has the negative binomial distribution \(F_m\).

One justification uses probability generating functions. For a nonnegative integer-valued variable \(X\), its probability generating function is \(G_X(z)=E[z^X]\), for values of \(z\) where the expectation is finite. From the probability mass function,

$$ \begin{aligned} G_{F_r}(z) &=\sum_{k=0}^{\infty}\binom{k+r-1}{r-1}p^r q^k z^k\\ &=p^r\sum_{k=0}^{\infty}\binom{k+r-1}{r-1}(qz)^k\\ &=\left(\frac{p}{1-qz}\right)^r. \end{aligned} $$

The last equality is the power-series identity \((1-w)^{-r}=\sum_{k=0}^{\infty}\binom{k+r-1}{r-1}w^k\), valid for \(|w|<1\). For independent variables, the generating function of a sum is the product of their generating functions: \(E[z^{X+Y}]=E[z^Xz^Y]=E[z^X]E[z^Y]\). Therefore,

$$ G_{F_{r_1}+\cdots+F_{r_m}}(z) =\prod_{j=1}^{m}\left(\frac{p}{1-qz}\right)^{r_j} =\left(\frac{p}{1-qz}\right)^{r_1+\cdots+r_m}. $$

This is the generating function of \(F_{r_1+\cdots+r_m}\), proving the result. The shared \(p\) is essential to this argument: it makes the factors have the same denominator and combines their exponents.

The standard moments follow from the same generating function. For \(F_r\), \(E[F_r]=G'_{F_r}(1)\), and \(\operatorname{Var}(F_r)=G''_{F_r}(1)+G'_{F_r}(1)-\{G'_{F_r}(1)\}^2\). Differentiating gives

$$ E[F_r]=\frac{rq}{p},\qquad \operatorname{Var}(F_r)=\frac{rq}{p^2}. $$

These formulas also provide a useful check on a sum: under the theorem, the mean and variance are those of the resulting \(F_{r_1+\cdots+r_m}\). They do not make the sum negative binomial when the closure conditions fail.

Applying the Result

1
Identify what each variable counts.
Determine whether it counts failures before a success or trials including a success. Convert trial counts into failure counts by subtracting the relevant number of successes.
2
Check independence and the success probability.
Confirm that the variables are independent and that each is based on the same \(p\). If either condition fails, do not invoke this closure result.
3
Add success targets and handle shifts.
For failure counts with a common \(p\), add the success targets \(r_j\). If trial counts are present, retain their added shift when translating back.
4
Calculate the requested quantity.
Use the negative binomial probability mass function or its moments, and check that the answer respects the variable's support.

Worked Example: Two Geometric Failure Counts

Two independent inspection sequences each continue until the first acceptable component is found. In each sequence, a component is acceptable with probability \(p=0.4\), independently from one trial to the next. Let \(G_1\) and \(G_2\) be the numbers of failures before the first acceptable component in the respective sequences. Find \(P(G_1+G_2\leq 2)\) and the mean of the sum.

Method. Each variable is geometric in the failures-before-success convention, and the variables are independent with common \(p=0.4\). Thus \(G_1+G_2\sim F_2\). Here \(q=1-0.4=0.6\).

For \(F_2\), the probability of \(k\) failures is \(\binom{k+1}{1}(0.4)^2(0.6)^k\). Calculate the three probabilities in the event:

$$ \begin{aligned} P(F_2=0)&=(0.4)^2=0.16,\\ P(F_2=1)&=\binom{2}{1}(0.4)^2(0.6) =2(0.16)(0.6)=0.192,\\ P(F_2=2)&=\binom{3}{1}(0.4)^2(0.6)^2 =3(0.16)(0.36)=0.1728. \end{aligned} $$

Therefore \(P(G_1+G_2\leq 2)=0.16+0.192+0.1728=0.5248\). The mean is

$$ E[G_1+G_2]=E[F_2]=\frac{2(0.6)}{0.4}=3. $$

Check. The sum has support \(0,1,2,\ldots\), so the event includes exactly the three terms used. The mean also equals the sum of the individual means, \(2(0.6/0.4)=3\). The common mistake avoided is treating “until the first success” as counting trials; the variables here count failures, so zero is possible.

Worked Example: Adding Negative Binomial Variables

Two independent production lines record the number of rejected units before reaching their targets. Line A stops at its second acceptable unit, and line B stops at its third. Each unit is acceptable with probability \(p=0.6\), independently across both lines. If \(F_A\) and \(F_B\) are the respective rejection counts, find \(P(F_A+F_B=2)\).

Method. Both variables count failures, both use \(p=0.6\), and they are independent. Hence \(F_A\sim F_2\), \(F_B\sim F_3\), and \(F_A+F_B\sim F_5\). With \(q=0.4\), the negative binomial formula gives

$$ \begin{aligned} P(F_A+F_B=2) &=P(F_5=2)\\ &=\binom{2+5-1}{5-1}(0.6)^5(0.4)^2\\ &=\binom{6}{4}(0.07776)(0.16)\\ &=15(0.07776)(0.16)\\ &=0.186624. \end{aligned} $$

To four decimal places, the probability is \(0.1866\). As an additional check, the combined target is \(2+3=5\) acceptable units; the two failures can appear in any of the \(\binom{6}{4}=15\) arrangements of five successes and two failures that end at the fifth success. Each such arrangement has probability \((0.6)^5(0.4)^2\).

The common mistake avoided is adding the two failure counts while retaining either original success target. The total number of required successes is five, so the correct distribution is \(F_5\), not \(F_2\) or \(F_3\).

Trial Counts and Shifts

Some questions define a geometric or negative binomial variable as the number of trials required, including the success on the final trial. Let \(T_r\) denote the number of trials through the \(r\)th success. Under the same Bernoulli model, \(T_r=F_r+r\). It follows that a sum of such trial counts is a shifted negative binomial variable:

$$ T_{r_1}+\cdots+T_{r_m} \ \overset{d}{=}\ F_{r_1+\cdots+r_m}+(r_1+\cdots+r_m), $$

when the underlying failure counts are independent and share \(p\). The equality is in distribution; it also follows directly by writing each trial count as its failure count plus its success target.

Worked Example: Combining Different Counting Conventions

A first independent sequence records \(T_2\), the number of trials through its second success. A second independent sequence records \(F_3\), the number of failures before its third success. Both use success probability \(p=0.5\) on independent Bernoulli trials. Find the probability that \(T_2+F_3=5\), and find the mean of the sum.

Method. Convert the trial count first: \(T_2=F_2+2\). The two failure counts are independent and have common \(p=0.5\), so \(F_2+F_3\sim F_5\). Thus \(T_2+F_3\) has the distribution of \(F_5+2\), with support \(2,3,\ldots\).

The event \(T_2+F_3=5\) is equivalent to \(F_5+2=5\), or \(F_5=3\). Therefore

$$ \begin{aligned} P(T_2+F_3=5) &=P(F_5=3)\\ &=\binom{3+5-1}{5-1}(0.5)^5(0.5)^3\\ &=\binom{7}{4}(0.5)^8\\ &=\frac{35}{256}=0.13671875. \end{aligned} $$

To four decimal places, the probability is \(0.1367\). For the mean, \(E[F_5]=5(0.5)/(0.5)=5\), so \(E[T_2+F_3]=E[F_5+2]=7\). Equivalently, \(E[T_2]=2/p=4\) and \(E[F_3]=3(0.5)/(0.5)=3\), giving \(4+3=7\).

Check. The minimum possible sum is two trials, because \(T_2\geq 2\) and \(F_3\geq 0\). The event value five is in the support. The common mistake avoided is treating \(T_2\) as a failure count: that would omit the shift of two and give the wrong event.

When Closure Does Not Apply

A common success probability is not a cosmetic condition. For example, let \(G_1\) and \(G_2\) be independent geometric failure counts with probabilities \(p_1=0.5\) and \(p_2=0.25\). Their sum is zero only when both variables are zero, so

$$ P(G_1+G_2=0)=p_1p_2=(0.5)(0.25)=0.125. $$

For the sum to have the distribution \(F_2\) for some success probability \(p'\), this zero probability would require \((p')^2=0.125\). That would give \(p'=1/\sqrt{8}\). But the actual probability of a sum of one is

$$ P(G_1+G_2=1) =P(G_1=1,G_2=0)+P(G_1=0,G_2=1) =(0.5)(0.75)+(0.5)(0.25)=0.5. $$

The proposed \(F_2\) model would instead give \(2(p')^2(1-p')=0.25(1-1/\sqrt{8})\), approximately \(0.1616\), not \(0.5\). Thus the sum is not \(F_2\) for any \(p'\). This calculation illustrates why the common-\(p\) condition cannot be ignored. When closure does not apply, a convolution or another justified method is needed.

Common Exam Traps

  • Mixing the two conventions. A count of failures before success can be zero; a count of trials through success cannot. Convert trial counts by adding or subtracting the number of successes involved.
  • Adding the wrong parameter. In a sum of failure counts with a shared \(p\), add the success targets \(r_j\), not the observed failures.
  • Using closure without checking assumptions. Independence and a common success probability are both required for the result stated here.
  • Dropping terms from a cumulative probability. For example, if \(F_3\) counts failures before the third success and \(p=0.25\), then \(P(F_3\leq 1)\) includes both \(F_3=0\) and \(F_3=1\): $$ P(F_3\leq 1)=(0.25)^3+\binom{3}{1}(0.25)^3(0.75) =0.015625+0.03515625=0.05078125. $$ To four decimal places this is \(0.0508\). A cumulative probability must include every integer in the event.
Key takeaway: Independent negative binomial failure counts with a shared success probability add by adding their success targets. Geometric failure counts are the special case with target one. Before calculating, identify whether each variable counts failures or trials; trial counts introduce a shift.

Check Your Understanding

For each problem, identify the convention and verify the support before using the closure result.

  1. \(G_1\) and \(G_2\) are independent geometric failure counts with common \(p=0.5\). Find \(P(G_1+G_2=1)\). (Answer: 0.2500)
  2. \(F_2\) and an independent geometric failure count \(G\) have common \(p=0.2\). Find \(P(F_2+G=0)\). (Answer: 0.0080)
  3. \(F_4\) counts failures before the fourth success, with \(p=0.5\). Find \(P(F_4\leq 1)\). (Answer: 0.1875)
  4. An independent process records \(T_3\), trials through the third success, and another records \(F_2\), failures before the second success. Both use \(p=0.4\). Find \(P(T_3+F_2=5)\). (Answer: 0.0553)
  5. Independent geometric failure counts \(G_1,G_2\) have probabilities \(p_1=0.5\) and \(p_2=0.25\). Find \(P(G_1+G_2=0)\) and \(P(G_1+G_2=1)\), and state whether the common-probability closure result applies. (Answer: \(0.1250\), \(0.5000\); no, the success probabilities differ.)
Clinical Biostats