$$\mathbb{E}[g(X)h(Y)]=\mathbb{E}[h(Y)\,\mathbb{E}[g(X)|Y]]$$
I am reading the book "An Introduction to Stochastic Modeling". This equation appears a lot but I can not see why.
Can anyone please provide some proofs and examples? Thanks a lot.
$$\mathbb{E}[g(X)h(Y)]=\mathbb{E}[h(Y)\,\mathbb{E}[g(X)|Y]]$$
I am reading the book "An Introduction to Stochastic Modeling". This equation appears a lot but I can not see why.
Can anyone please provide some proofs and examples? Thanks a lot.
For any random variables $Z$ and $Y$ with $Z$ integrable we have $E(Z) = E[ E(Z\mid Y) ] $. Apply this to $$Z:=g(X)h(Y)$$ and note that $$E(g(X)h(Y)\mid Y ) = h(Y) E(g(X)\mid Y), $$ since $h(Y)$ is measurable with respect to $\sigma(Y)$.