Why Condition on the Count?
For a random sum, \(S=\sum_{j=1}^{N}X_j\), variation can arise in two distinct ways: the number of terms \(N\) can vary, and the terms themselves can vary. Conditioning on \(N\) separates these sources. If the summands also share a latent influence, or their dependence changes with the count, conditioning on the count alone may not be enough; the conditioning variable must capture the relevant structure.
The central tool is the law of total variance. It gives a general decomposition first; familiar formulas for random sums follow only after the conditional mean, conditional variance, and required moment conditions have been established. This approach is aligned with the SOA Exam P (Probability) syllabus.
Deriving the Decomposition
Write \(m(C)=E[S\mid C]\). Add and subtract this conditional mean:
Squaring and taking expectations produces two squared terms and a cross term. The cross term is zero: conditional on \(C\), the first factor has mean \(E[S-m(C)\mid C]=0\), while \(m(C)-E[S]\) is determined by \(C\). Therefore,
The finite-second-moment condition ensures these variances are defined. In applications, it is important to verify that condition rather than mechanically substituting into a variance formula.
Independent Summands and a Random Count
Suppose \(N\) is a nonnegative integer-valued random variable, and \(X_1,X_2,\ldots\) are independent and identically distributed summands, independent of \(N\). Let \(E[X_j]=\mu\) and \(\operatorname{Var}(X_j)=\sigma^2<\infty\), and define \(S=0\) when \(N=0\). A sufficient condition for the usual random-sum variance formula is \(E[N^2]<\infty\). Then \(S\) has a finite second moment, and conditioning on \(N=n\) gives
The conditional mean follows by adding \(n\) means. The conditional variance is the sum of \(n\) variances because, given the count, the summands are independent. Applying the decomposition with \(C=N\) yields
The condition \(E[N^2]<\infty\) is not a technical detail to ignore. Finite mean and variance for each summand do not by themselves guarantee that \(S\) has a finite variance when the count can be very large. For example, a count with infinite mean and bounded Bernoulli summands can produce a sum with infinite mean, so the ordinary variance decomposition cannot be used as if all terms were finite.
Worked Example: An Independent Random Sum
A hypothetical device can produce \(N\sim\operatorname{Binomial}(3,0.5)\) signals. Independently, each signal contributes \(1\) or \(3\) units with equal probability, independently of the other contributions. Find the mean and variance of the total \(S\).
Method and assumptions. The count is independent of an iid sequence of summands. The count is bounded, so \(E[N^2]<\infty\); the summands have finite variance. Thus the independent random-sum formula applies.
For one contribution,
For the count,
The expected total is \(E[S]=\mu E[N]=2(1.5)=3\). Its variance is
Check. The within-count contribution is \(1.5\), and the variation in the conditional mean \(2N\) contributes \(4\operatorname{Var}(N)=3\). These add to \(4.5\). The common mistake to avoid is omitting the second term and reporting only the expected conditional variance, \(1.5\).
When the Summands Depend on One Another
If the first \(n\) terms have conditional mean \(\mu\), conditional variance \(\sigma^2\), and common pairwise conditional covariance \(c\) given \(N=n\), then
There are \(n\) individual variance terms and \(n(n-1)\) ordered cross-covariance terms in the variance of a sum. If these conditional moments are the same for every \(n\), and \(E[N^2]<\infty\), the decomposition gives
This formula requires the stated conditional means, variances, and covariances; it is not a general formula for arbitrary dependent summands. If these quantities vary with \(n\), use \(E[\operatorname{Var}(S\mid N)]+\operatorname{Var}(E[S\mid N])\) directly.
Worked Example: A Shared Latent Probability
Let \(N\sim\operatorname{Binomial}(2,0.5)\). Independently of \(N\), a latent state \(Z\) equals \(0\) or \(1\) with probability \(0.5\) each. Given \(Z\), the summands are conditionally iid Bernoulli, with success probability \(q_0=0.25\) if \(Z=0\) and \(q_1=0.75\) if \(Z=1\). Find \(\operatorname{Var}(S)\).
Method and assumptions. Condition first on both \(N\) and \(Z\). Given these, the included Bernoulli terms are independent. The count is bounded, so all required second moments are finite.
The average success probability and the average conditional Bernoulli variance are
Also,
Given \(N=n\), conditioning on \(Z\) gives conditional mean \(nq_Z\) and conditional variance \(nq_Z(1-q_Z)\). Applying the decomposition over \(Z\),
For the count, \(E[N]=1\), \(\operatorname{Var}(N)=0.5\), and \(E[N^2]=1.5\). Therefore,
Check and trap. A single summand has marginal mean \(0.5\) and variance \(0.25\). Treating the summands as independent would give \(0.25(1)+0.25(0.5)=0.375\), which is too small. The shared \(Z\) makes two summands positively dependent: their covariance is \(\operatorname{Var}(q_Z)=1/16\). The expected pair contribution is \(E[N(N-1)]/16=0.5/16=1/32\), exactly the missing amount. The correct variance is \(0.375+0.03125=0.40625\).
When the Count and Summand Distribution Are Related
A random count need not be independent of the mechanism generating the summands. A useful model has a latent variable \(Z\) such that, given \(Z\) and \(N\), the included terms are independent with conditional mean \(\mu_Z\) and conditional variance \(\sigma_Z^2\). Provided the relevant second moments are finite,
and hence
This form does not assume that \(N\) and \(Z\) are independent. If they are dependent, the expectation and variance must retain their joint relationship. Conditioning on \(Z\) can be especially useful when it explains both the count and the summand distribution.
Worked Example: A Count Linked to the Environment
A hypothetical process has a latent state \(Z\), with \(P(Z=0)=P(Z=1)=0.5\). If \(Z=0\), then \(N=1\) and each included term is Bernoulli with success probability \(0.25\). If \(Z=1\), then \(N=3\) and each included term is Bernoulli with success probability \(0.75\). Given the state, the terms are independent. Find the mean and variance of \(S\).
Method and assumptions. Condition on \(Z\), which determines both the count and the conditional summand distribution. The count is at most three, so the sum has a finite second moment.
When \(Z=0\), the conditional mean and variance are \(1(0.25)=0.25\) and \(1(0.25)(0.75)=3/16\). When \(Z=1\), they are \(3(0.75)=2.25\) and \(3(0.75)(0.25)=9/16\). Thus,
The two conditional means are \(0.25\) and \(2.25\). Their average is \(1.25\), and each is one unit from that average, so
Therefore,
Check. The conditional second moments are \(3/16+(1/4)^2=1/4\) in state \(0\), and \(9/16+(9/4)^2=45/8\) in state \(1\). Their average is \(47/16\); subtracting \((E[S])^2=(5/4)^2=25/16\) gives \(22/16=11/8\). The trap is to use an unconditional summand mean and variance as though the count were independent of the summand mechanism; here the state links them.
Choosing and Checking the Conditioning Variable
For a random sum, conditioning on \(N\) is effective when it makes the conditional mean and variance manageable. If summands share an environmental effect, condition on that effect as well, or explicitly include the resulting conditional covariance. A reliable calculation follows these steps:
Define the count, summands, and any latent variable. Specify which quantities are independent or independent only after conditioning.
Check that the sum has a finite second moment. For an independent random count with iid finite-variance summands, \(E[N^2]<\infty\) is a sufficient count condition.
Compute \(E[S\mid C]\) and \(\operatorname{Var}(S\mid C)\), including any cross-covariance terms that remain after conditioning.
Add the expected conditional variance and the variance of the conditional mean. Check whether a shared source of variation has been omitted.
The main exam trap is confusing “identically distributed” with “independent.” Identical marginal distributions do not eliminate covariance. Another is using a correct-looking formula without the assumptions that justify it. The safest practice is to write the conditional mean and variance before substituting into the total-variance identity.
Check Your Understanding
For each problem, identify the relevant conditioning structure before calculating.
- \(N\sim\operatorname{Binomial}(4,0.25)\) is independent of iid Bernoulli\((0.5)\) summands. Find the mean and variance of their random sum. (Answer: mean \(0.5\), variance \(7/16=0.4375\))
- Given \(N=4\), four summands each have conditional mean \(3\), conditional variance \(2\), and every pair has conditional covariance \(0.5\). Find the conditional variance of their sum. (Answer: \(14\))
- A fixed count of \(2\) terms shares a latent state: \(Z=0\) or \(1\) with equal probabilities, and given \(Z\) the terms are iid Bernoulli with success probability \(0.2\) or \(0.8\), respectively. Find the variance of the sum. (Answer: \(0.68\))
- \(N\sim\operatorname{Poisson}(2)\) is independent of iid summands with mean \(1\) and variance \(4\). Find the variance of the random sum. (Answer: \(10\))
- \(Z=0\) or \(1\) with equal probabilities. If \(Z=0\), \(N=1\) and the summand success probability is \(0.2\); if \(Z=1\), \(N=2\) and the success probability is \(0.6\). Given \(Z\), the summands are independent Bernoulli variables. Find the variance of the random sum. (Answer: \(0.57\))