Let $(\Omega, \mathcal{A}, P)$ be a probability space and $X,Y: \Omega \rightarrow \mathbb{R}$ two random variables. Now, assume $f$ is a function such that $\mathbb{E}[|f(X,Y)|] < \infty$. If $X$ an $Y$ are independent I know that the following statement holds: $$ \mathbb{E}[f(X,Y)| X] = \mathbb{E}[f(x,Y)]_{x = X}. $$
My (probably rather obvious) questions are:
- By applying the expectation I get from above $$ \mathbb{E}[f(X,Y)] = \mathbb{E}[\mathbb{E}[f(x,Y)]_{x = X}]. $$ Is the reverse direction also true?
- Can I use the above statement as a direct definition of independence in the sense of "$X$ and $Y$ are independent if and only if the above statement holds for all $f$"?
- However, I have some difficulties in intuitively handling the expression $\mathbb{E}[f(x,Y)]_{x = X}$. Some elaboration with examples would be great! I am not sure whether I understand the above statement intuitively.
Thank you in advance for your help!
Here is an example where you are naturally led to use the result: Let $(X_i)_{i \in \mathbb{N}}$ be independent integrable real valued random variables. For $n \in \mathbb{N}_0$, let $S_n = X_1 + \dots + X_n$. For any $n \in \mathbb{N}$, $E(S_n \mid X_1, \dots, X_{n - 1}) = S_{n - 1} + E(X_n)$.