Interchange of Expectations Could someone please explain when for two random variables $X$ and $Y$ 
$E_XE_Y (f(X,Y)) = E_Y E_X (f(X,Y))$?
In particular should they be independent ?
 A: If $f$ is bounded or positive, this is always true by Fubini's theorem. Let $X$ take values in $\mathcal X$ with distribution $P_X$ and $Y$ take values in $\mathcal Y$ with distribution $P_Y$. Your equation is
$$\int_{x\in\mathcal X}\int_{y\in\mathcal Y}f(x,y)dP_YdP_X=\int_{x\in\mathcal Y}\int_{y\in\mathcal X}f(x,y)dP_XdP_Y$$
For bounded or positive $f$, Fubini's theorem states that both of these are equal to
$$\int_{\mathcal X\times\mathcal Y}f(x, y)d(P_X\times P_Y)$$
where $P_X\times P_Y$ is the product measure. All this is true with absolutely no assumptions on $(X, Y)$, it's just that when $X$ and $Y$ are not independent, the measure $P_X\times P_Y$ has no natural probabilistic meaning. One way of defining independence of variables is by the equation $P_{(X,Y)}=P_X\times P_Y$. Thus, if and only if $X$ and $Y$ are independent is the above integral equal to
$$\int_{\mathcal X\times\mathcal Y}f(x,y)dP_{(X,Y)}=E(f(X,Y))$$
In brief: your integrals are always equal (for well behaved $f$), but if and only if $X$ and $Y$ are independent are they equal to $E(f(X,Y))$.
