I've been very stuck on a question from Probability and Random Processes by Grimmett and Stirzaker for ages - so stuck that I flicked to the back to have a look at the answers. But, I can't seem to even understand the reasoning behind that!
The question is: Construct an example of two random variables X and Y for which $\mathbb{E}(Y)=\infty$ but $\mathbb{E}(Y|X)<\infty$.
The answer given is: Take Y to be a random variable with mean $\infty$, say $f_{Y}(y)=y^{-2}$ for $1 \leq y<\infty$, and let X=Y. Then $\mathbb{E}(Y|X)=X$ which is (almost surely) finite.
Firstly, how can a random variable have infinite mean? Secondly, I don't really understand the subtlety of letting X=Y and finally what's with the "(almost surely)"?
Thanks in advance for your help!
A random variable $Y$ has infinite mean if $\mathbb{E}[Y] = \infty$; in your case, this happens since $$ \int_1^{\infty} y f_Y(y) dy = \int_1^\infty \frac{1}{y} dy = \infty. $$
$X$ and $Y$ are just functions. As long as they are measurable (which you don't really need to worry about) you have valid random variables. I wouldn't call it sublte. Many other choices would have worked ($X = Y^3$ for instance). Here, once you "know" the value of $X$, you also "know" the value of $Y$, and it will always be finite. Each value of the function is finite, even though the integral above is infinite.
Any statement that has "almost surely" at the end of it means that the set on which the claim is true has measure $1$. In this case, the reason we write "a.s." in $$ \mathbb{E}[Y \mid X] = Y \ \ \mbox{a.s.} $$ is that conditional expectations are really choices of Radon-Nikodym derivatives (functions which satisfy 2 properties) and for some choices the equality holds everywhere, and for others it holds only "almost everywhere".