How Do You Sum a Random Number of Independent Variables?
At a glance
- 1. Define the random sum
Let N be a nonnegative integer-valued count and add the first N terms of a sequence.
- 2. Check independence
For the standard formulas, N must be independent of the mutually independent, identically distributed summands.
- 3. Condition on the count
Given N, use the usual formulas for a fixed number of summands.
- 4. Apply total expectation and variance
Average the conditional mean and combine the average conditional variance with the variance of the conditional mean.
A random sum has a random number of terms as well as random terms. A standard example is the total reward from a random number of events. To calculate its mean and variance, you need to account for both sources of randomness.
The formulas below assume the count is independent of the summands, and that the summands are mutually independent and identically distributed (iid). If those assumptions do not hold, the result can change.
The random-sum formulas
Let be a nonnegative integer-valued random variable, and let be iid random variables independent of . Define
with . Write and . If the relevant expectations and variances are finite, then
and
The first formula says that the expected total is the expected number of terms multiplied by the expected value of each term. The variance has two parts: variation in the individual terms, , and variation in how many terms are included, .
Why the formulas work
Condition on the value of . If , the sum contains a fixed number of independent terms, so
Taking the expectation of the conditional mean gives the mean of the random sum:
For the variance, use the law of total variance:
This argument is often the quickest way to solve a random-sum problem: find the conditional mean and variance for a fixed count, then apply the two laws of total expectation and variance.
Worked example
Suppose a number of events has a Poisson distribution with mean . Each event independently contributes either or units, with equal probability. Let be the contribution from event .
For one event,
For a Poisson random variable with parameter , both and equal . Therefore,
and
So the expected total contribution is units, and its variance is units squared. The standard deviation is , about units.
For a Poisson count with mean , the same formulas give and . The latter can also be written .
Finding the distribution
If you need the full distribution rather than just its mean and variance, condition on . For any measurable set ,
where the sum of zero terms is defined to be .
For moment-generating functions, when they exist, let and let be the probability-generating function of . Independence gives
This composition is useful when the individual summand and the count have known distributions.
Common mistakes and variations
- Leaving out the count’s variability. The variance is not generally just . The additional term is needed unless the count is fixed, or the summands have mean zero.
- Assuming independence without checking it. The formulas require to be independent of the sequence of summands. If the number of terms is chosen based on their values, conditioning can change the distribution of the included terms.
- Assuming identical distributions. If the independent summands have different means but are independent of , the expectation instead takes the form , provided expectation and summation can be interchanged (for example, if ). The simple product uses a common mean.
For example, if are fair Bernoulli variables and is the index of the first success, then with certainty. Here depends on the summands, so the independent-count variance formula does not apply. Always check how the count is generated before using the random-sum formulas.
References
- Introduction to Probability Models, Sheldon M. Ross
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.