# Math Help - Quick question on conditional expectation

1. ## Quick question on conditional expectation

Let x,y be continous random variables.

Prove that E(E(y|x)) = E(y)

I am sure this is a very basic question but still if someone can provide/guide towards a rigourous proof for the same?

Thanks

2. In fact I realised that the more generic result will hold true

E(E(f(x,y)|x)) = E(f(x,y)), where f(x,y) is a real valued function on (x,y)

E stands for expected value.

Any help/pointers to prove this (in a rigorous way) will be great ! Thanks

3. It's true in any case, but the continuous case is easy...

$E(Y|X)=\int yf(y|X)dy$ which is a function of X

next integrate wrt x and multiply the densities...

$E(E(Y|X))=\int\left(\int yf(y|x)dy\right)f_X(x)dx$

Fubini... $=\int\int yf(y|x)dyf_X(x)dx=\int\int yf(x,y)dxdy=E(Y)$