Law of total expectation
The proposition in probability theory known as the law of total expectation,[1] the law of iterated expectations[2] (LIE), Adam's law,[3] the tower rule,[4] and the smoothing theorem,[5] among other names, states that if
X
{\displaystyle X}
is a random variable whose expected value
E
⁡
(
X
)
{\displaystyle \operatorname {E} (X)}
is defined, and
Y
{\displaystyle Y}
is any random variable on the same probability space, then
https://en.wikipedia.org/wiki/Law_of_total_expectation