# Why E[E[Y|X]] = E[Y] [closed]

I don't understand how the expected value of the conditional expectation of Y given x is equal to the Expected value of Y. How should I prove it?

If we sustitute the values in probabilities density functions we have that

E[E[Y|X]] = SUM (E[Y|X=x]) * P(X=x)

Which is...

E[E[Y|X]] = SUM (INTEGER(-INF, INF) Xf(x|y)dx) * P(X=x)

Then the E[E[Y|X]] is the summatory of the integer Xf(x|y)dx times the probability of X when X is x?

How could I apply this in a real example, let's say throwing 2 dice

• This is called the "tower rule", you'll find multiple proofs of it on Wikipedia/YouTube, if you're interested. Aug 31, 2022 at 13:30
• This is Adam's law and you can find the proof in Page 396 of Introduction to Probability by Joseph K. Blitzstein. Aug 31, 2022 at 13:44

## 1 Answer

As you have sums in your question I will assume that you work with discrete random variables. In that case we can do the calculation \begin{align} E[E[Y|X]]&=\sum_xE[Y|X=x]\cdot P(X=x) \\ &=\sum_x\sum_yy\cdot P(Y=y|X=x)\cdot P(X=x) \\ &=\sum_x\sum_yy\cdot P(Y=y,X=x) \\ &=\sum_yy\sum_xP(Y=y,X=x) \\ &=\sum_yy\cdot P(Y=y) \\ &=E[Y]. \end{align} So basically the good old trick; whenever you encounter two sums you should probably swap them. Note that this is allowed here if we assume that $$E[Y]$$ exists.