The expectation of a distribution can be seen as the weighted sum Theorem E(Y)=E[E(Y∣X)]={ΣxE(Y∣X=x)pX(x)∫RE(Y∣X=x)fX(x)dx