Law of Iterated Expectations: A Worked Example
At a glance
- 1. Choose a condition
Identify the random variable or information you will condition on.
- 2. Find conditional means
Calculate the expected value of the outcome separately for each condition.
- 3. Weight the means
Average those conditional means using the probabilities of the conditions.
- 4. Check directly
When possible, compute the unconditional expectation from the outcome probabilities and compare.
The law of iterated expectations lets you find an overall mean by first calculating conditional means and then averaging them. It is also called the tower property. The key is to weight each conditional mean by how likely its condition is.
The law in symbols
If is an integrable random variable and is another random variable, then
The inner conditional expectation, , is itself a random variable: its value depends on the value of . The outer expectation averages that random variable over the possible values of .
For a discrete variable , this becomes
where the sum runs over the possible values of . This is a weighted average of conditional means. For continuous variables, the sum is replaced by an integral over the distribution of .
Worked example: choosing a bag
Suppose you choose one of two bags. Bag A is chosen with probability , and bag B with probability . You then draw one number from the chosen bag:
- Bag A contains 0 and 6, each with probability .
- Bag B contains 3 and 9, each with probability .
Let be the bag chosen and let be the number drawn. First compute the mean within each bag:
Now average those means, weighting by the probabilities of choosing each bag:
You can verify the result by finding the overall probabilities of the four possible draws. The outcomes 0 and 6 each have probability . The outcomes 3 and 9 each have probability . Thus
Both calculations give the same overall mean. The first groups the calculation by bag; the second groups it by the number drawn.
Why the rule works
If has finitely many possible values, those values split all outcomes into separate cases. In each case, calculate the average of under that condition. The overall average is then the sum of those case averages, each multiplied by the probability of its case. This is the same weighted-average principle used to combine group means.
For a continuous , the same idea applies across its range. In density notation, when the relevant densities and expectations exist,
where is the probability density of . More generally, the theorem is stated using conditional expectation given the information generated by ; it does not require to be discrete or continuous.
Common mistakes
Taking an unweighted average. In the bag example, averaging 3 and 6 gives 4.5, which is wrong because the bags are not equally likely. Use the probabilities of the conditions as weights.
Treating the conditional mean as a fixed number. The notation represents a random variable that changes with . By contrast, is the conditional mean for one specified value .
Assuming independence. The law does not say that and are independent. It holds whether or not they are related. If they are independent, then (under the usual conditions), so the identity becomes immediate.
Moving nonlinear functions through an expectation. In general, is not equal to . The tower property applies by taking the expectation of a conditional expectation; it does not make expectation commute with arbitrary functions.
When this is useful
Use the law when a problem naturally separates into groups, stages, or scenarios. For example, you might first condition on a customer type, a weather state, or the number of trials, calculate the expected outcome within each case, and then average over the cases. It is also a standard step in probability proofs and in calculations involving conditional models.
The same principle works with more information: if you condition first on one information set and then on a coarser one, the conditional expectations can be averaged in stages. This is why the identity is known as the tower property.
References
- Probability and Statistics, Morris H. DeGroot and Mark J. Schervish
- A First Course in Probability, Sheldon Ross
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.