# Law of total expectation

The law of total expectation is a theorem of probability theory stating that the expected value of a random variable equals the probability-weighted average of its expected values conditioned on the events of any partition of the sample space. In its compact form, \( \mathbf{E}[X] = \mathbf{E}[\mathbf{E}[X \mid Y]] \), it is also called the law of iterated expectations, the tower property, or, informally, Adam's law.<sup>[1](https://statproofbook.github.io/P/mean-tot.html)</sup><sup> • </sup><sup>[2](https://www.stat.berkeley.edu/~aditya/resources/AllLectures2018Fall201A.pdf)</sup>

| Key fact | Detail |
|---|---|
| Event form | For disjoint events \( A_1, \ldots, A_n \) forming a partition with \( \mathbf{P}(A_i) > 0 \): \( \mathbf{E}[X] = \sum_{i=1}^{n} \mathbf{P}(A_i)\,\mathbf{E}[X \mid A_i] \)<sup>[3](https://ocw.mit.edu/courses/res-6-012-introduction-to-probability-spring-2018/d973b10c2587781f86ca4f2aff49098f_MITRES_6_012S18_Textbook.pdf)</sup> |
| Random-variable form (discrete) | \( \mathbf{E}[X] = \sum_{y} \mathbf{E}[X \mid Y=y]\, p_Y(y) \)<sup>[4](https://probability4datascience.com/eBook/ch05-4.html)</sup> |
| Random-variable form (continuous) | \( \mathbf{E}[X] = \int_{-\infty}^{\infty} \mathbf{E}[X \mid Y=y]\, f_Y(y)\, dy \)<sup>[3](https://ocw.mit.edu/courses/res-6-012-introduction-to-probability-spring-2018/d973b10c2587781f86ca4f2aff49098f_MITRES_6_012S18_Textbook.pdf)</sup> |
| Compact form | \( \mathbf{E}[X] = \mathbf{E}[\mathbf{E}[X \mid Y]] \), the law of iterated expectations<sup>[1](https://statproofbook.github.io/P/mean-tot.html)</sup> |
| Measure-theoretic form | For integrable \( Y \) and any sub-\( \sigma \)-algebra \( \mathcal{G} \): \( \mathbf{E}[\mathbf{E}[Y \mid \mathcal{G}]] = \mathbf{E}[Y] \)<sup>[5](https://choxos.github.io/Mathematics-of-ITC/chapters/part1/04-probability.html)</sup> |
| Tower property | For \( \mathcal{H} \subseteq \mathcal{G} \): \( \mathbf{E}[\mathbf{E}[X \mid \mathcal{G}] \mid \mathcal{H}] = \mathbf{E}[X \mid \mathcal{H}] \) almost surely<sup>[6](https://math.berkeley.edu/~ltomczak/notes/Mich2022/AdvProb_Notes.pdf)</sup> |
| Companion result | The law of total variance, \( \mathrm{Var}(X) = \mathbf{E}[\mathrm{Var}(X \mid Y)] + \mathrm{Var}(\mathbf{E}[X \mid Y]) \), is proved using the law of total expectation<sup>[7](https://agdenadel.github.io/Law-of-Total-Variance/)</sup> |

## Statement and forms

The theorem comes in three equivalent shapes. The event form applies when \( A_1, A_2, \ldots, A_n \) are disjoint events that form a partition of the sample space and each has positive probability; the overall expectation is then the sum of the conditional expectations, each weighted by the probability of its conditioning event.<sup>[3](https://ocw.mit.edu/courses/res-6-012-introduction-to-probability-spring-2018/d973b10c2587781f86ca4f2aff49098f_MITRES_6_012S18_Textbook.pdf)</sup> The random-variable form replaces the partition with the values of a random variable \( Y \): for discrete \( Y \), \( \mathbf{E}[X] = \sum_{y} \mathbf{E}[X \mid Y=y]\, p_Y(y) \), and for jointly continuous \( X \) and \( Y \), the sum becomes an integral against the density \( f_Y(y) \).<sup>[4](https://probability4datascience.com/eBook/ch05-4.html)</sup><sup> • </sup><sup>[3](https://ocw.mit.edu/courses/res-6-012-introduction-to-probability-spring-2018/d973b10c2587781f86ca4f2aff49098f_MITRES_6_012S18_Textbook.pdf)</sup>

The compact form treats \( \mathbf{E}[X \mid Y=y] \) as a function \( h(y) \) and applies it to the random variable \( Y \), producing a new random variable \( \mathbf{E}[X \mid Y] = h(Y) \). Taking its expectation with respect to \( Y \) recovers \( \mathbf{E}[X] \), so the law reads \( \mathbf{E}[X] = \mathbf{E}[\mathbf{E}[X \mid Y]] \).<sup>[2](https://www.stat.berkeley.edu/~aditya/resources/AllLectures2018Fall201A.pdf)</sup><sup> • </sup><sup>[8](https://courses.cs.washington.edu/courses/cse312/26sp/files/sections/section9/section9.html)</sup> Because two expectations appear nested on the right-hand side, the result is also known as the law of iterated expectations.<sup>[2](https://www.stat.berkeley.edu/~aditya/resources/AllLectures2018Fall201A.pdf)</sup>

In measure-theoretic probability, where conditional expectation given a sub-\( \sigma \)-algebra \( \mathcal{G} \) is the primitive object, the law states that \( \mathbf{E}[\mathbf{E}[Y \mid \mathcal{G}]] = \mathbf{E}[Y] \) for any integrable \( Y \).<sup>[5](https://choxos.github.io/Mathematics-of-ITC/chapters/part1/04-probability.html)</sup>

## Proof idea

The discrete proof is a direct application of the law of total probability. Writing the marginal probability as a sum over joint probabilities, \( p_X(x) = \sum_y p_{X \mid Y}(x \mid y)\, p_Y(y) \), and substituting into the definition of \( \mathbf{E}[X] \) gives

\[ \mathbf{E}[X] = \sum_x x \sum_y p_{X \mid Y}(x \mid y)\, p_Y(y) = \sum_y \left( \sum_x x\, p_{X \mid Y}(x \mid y) \right) p_Y(y) = \sum_y \mathbf{E}[X \mid Y=y]\, p_Y(y). \]

The continuous case follows by replacing summation with integration.<sup>[4](https://probability4datascience.com/eBook/ch05-4.html)</sup> Equivalently, the law can be proved as a consequence of the law of total probability applied to densities: \( f_Y(y) = \int f_{Y \mid X=x}(y) f_X(x)\, dx \), and exchanging the order of integration yields \( \mathbf{E}[Y] = \int \mathbf{E}[Y \mid X=x]\, f_X(x)\, dx \).<sup>[2](https://www.stat.berkeley.edu/~aditya/resources/AllLectures2018Fall201A.pdf)</sup>

## The tower property

The law generalizes to nested conditioning on two pieces of information. If \( \mathcal{H} \subseteq \mathcal{G} \subseteq \mathcal{F} \) are sub-\( \sigma \)-algebras, then

\[ \mathbf{E}[\mathbf{E}[X \mid \mathcal{G}] \mid \mathcal{H}] = \mathbf{E}[X \mid \mathcal{H}] \quad \text{a.s.} \]

and the same value is obtained by conditioning in the other order. Only the smallest \( \sigma \)-algebra matters: once randomness has been averaged over a coarser information set, finer conditioning cannot recover it.<sup>[6](https://math.berkeley.edu/~ltomczak/notes/Mich2022/AdvProb_Notes.pdf)</sup><sup> • </sup><sup>[9](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)</sup> Taking \( \mathcal{H} \) to be the trivial \( \sigma \)-algebra \( \{\emptyset, \Omega\} \) recovers the law of total expectation as a special case.<sup>[9](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)</sup>

Two trivial cases anchor the intuition: if \( X \) is independent of \( \mathcal{G} \), then \( \mathbf{E}[X \mid \mathcal{G}] = \mathbf{E}[X] \), and if \( X \) is \( \mathcal{G} \)-measurable, then \( \mathbf{E}[X \mid \mathcal{G}] = X \).<sup>[9](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)</sup>

## Why it is useful

The law is a decomposition rule: it breaks a hard expectation into smaller, easier conditional expectations and averages them with the probabilities of the conditioning cases.<sup>[4](https://probability4datascience.com/eBook/ch05-4.html)</sup> Textbooks present it as the standard way to divide a complicated calculation into simpler cases, computing the conditional expectation in each case and weighting by the case probability.<sup>[10](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup> A classic illustration conditions a person's height on sex: with 49.8 percent of a population male, the overall expected height is 0.498 times the male conditional mean plus the corresponding female term.<sup>[10](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)</sup> The same structure handles recursive situations such as the expected number of trials in a geometric experiment, where conditioning on the outcome of the first trial produces an equation the law lets you close.<sup>[11](https://www.probabilitycourse.com/chapter5/5_1_3_conditioning_independence.php)</sup>

The law also underlies the interpretation of conditional means as predictions. The function \( \mathbf{E}[X \mid Y] \) is the best possible predictor of \( X \) from \( Y \) in the mean-square sense, which is why regression is about conditional means.<sup>[12](https://calc-path.com/probability/modules/expectation)</sup> In econometrics, the law of iterated expectations is used to show that a regression disturbance orthogonal to the conditioning variables has zero unconditional mean, so the linear projection coefficients take their familiar forms.<sup>[13](https://people.stern.nyu.edu/wgreene/Econometrics/Econometrics-I-2.pdf)</sup>

**Related identities.** The law of total variance, which splits variance into a within-group part and a between-group part, is proved using the law of total expectation together with the definition of conditional variance.<sup>[7](https://agdenadel.github.io/Law-of-Total-Variance/)</sup> In Bayesian statistics, the law of total variance generates alternative expressions for posterior predictive variance in hierarchical models, and the constancy of that variance across expressions acts as a conservation check on the calculations.<sup>[14](https://arxiv.org/abs/2406.11806)</sup>

## Names

The theorem carries many names in the literature: law of total expectation, law of iterated expectations, total expectation theorem, and tower property.<sup>[1](https://statproofbook.github.io/P/mean-tot.html)</sup><sup> • </sup><sup>[15](https://proofwiki.org/wiki/Total_Expectation_Theorem)</sup> In the popular Harvard Stat 110 tradition it is called Adam's law; according to Joe Blitzstein, Professor of the Practice in [Statistics](https://www.edgepedia.org/statistics) at Harvard University, that name can be traced back to [Jerzy Neyman](https://www.edgepedia.org/jerzy-neyman), the founder of the Berkeley statistics department.<sup>[16](https://math.stackexchange.com/questions/4857382/lotus-and-adams-law-nomenclature)</sup>

## Applications in causal inference

When causal consistency, positivity, and conditional exchangeability hold, the law of iterated expectations can be recast as the g-formula—causal inference's standardization formula—expressed in two ways that are equivalent without parametric assumptions: a NICE version, which uses one weighted average of conditional outcome means, and an ICE version, built from expectations nested within one another.<sup>[17](https://arxiv.org/abs/2606.20078)</sup>

## References

1. [Proof: Law of total expectation, The Book of Statistical Proofs](https://statproofbook.github.io/P/mean-tot.html)
2. [Statistics 201A lecture notes, University of California, Berkeley](https://www.stat.berkeley.edu/~aditya/resources/AllLectures2018Fall201A.pdf)
3. [Introduction to Probability (Bertsekas and Tsitsiklis), textbook summary, MIT OpenCourseWare](https://ocw.mit.edu/courses/res-6-012-introduction-to-probability-spring-2018/d973b10c2587781f86ca4f2aff49098f_MITRES_6_012S18_Textbook.pdf)
4. [Introduction to Probability for Data Science, Section 5.4](https://probability4datascience.com/eBook/ch05-4.html)
5. [The Mathematics of Indirect Treatment Comparisons, Chapter 4](https://choxos.github.io/Mathematics-of-ITC/chapters/part1/04-probability.html)
6. [Advanced Probability lecture notes, UC Berkeley](https://math.berkeley.edu/~ltomczak/notes/Mich2022/AdvProb_Notes.pdf)
7. [Law of Total Variance, A. DenAdel](https://agdenadel.github.io/Law-of-Total-Variance/)
8. [CSE 312 Section 9, University of Washington](https://courses.cs.washington.edu/courses/cse312/26sp/files/sections/section9/section9.html)
9. [Conditional expectation, MATH4/67201 Martingale Theory notes](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)
10. [Mathematics for Computer Science (6.042J) course notes, MIT OpenCourseWare](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/93cad640cf3ed0b23ef70688f452d4d5_MIT6_042JF10_notes.pdf)
11. [Conditioning, Independence, CDF, ProbabilityCourse.com](https://www.probabilitycourse.com/chapter5/5_1_3_conditioning_independence.php)
12. [Probability: Expectation, Covariance and Conditional Expectation](https://calc-path.com/probability/modules/expectation)
13. [Econometrics I, W. Greene, NYU Stern](https://people.stern.nyu.edu/wgreene/Econometrics/Econometrics-I-2.pdf)
14. [A conservation law for posterior predictive variance, arXiv](https://arxiv.org/abs/2406.11806)
15. [Total Expectation Theorem, ProofWiki](https://proofwiki.org/wiki/Total_Expectation_Theorem)
16. [LOTUS and Adam's Law nomenclature, Mathematics Stack Exchange](https://math.stackexchange.com/questions/4857382/lotus-and-adams-law-nomenclature)
17. [A Law of Iterated Expectation Primer for Causal Inference, arXiv](https://arxiv.org/abs/2606.20078)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Statistics and probability › Probability theory › Expectation, moments, and inequalities › Laws and rules of expectation*

*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
