Question: Let $X_1$, $X_2$, and Z denote independent, real-valued random variables. Assume that $Pr(Z=0) = 1 - Pr(Z=1)$ = $\alpha$ for some $0 < \alpha < 1$. Define
$Y = \left\{
\begin{array}{l l}
X_1 & \quad \text{if $Z$ = 1}\\
X_2 & \quad \text{if $Z$ = 0}
\end{array} \right.$
a) Suppose that $E(X_1)$ and $E(X_2)$ exist. Does it follow that $E(Y)$ exists?
b) Assume that $E(|X_1|)$ < $\infty$ and $E(|X_2|)$ < $\infty$. Find $E(Y|X_1)$.
Answer: For part a), I'm not sure how to go about determining whether or not $E(Y)$ exists. I assume it does, as $E(Y|Z=z)$ = $Pr(Y|Z=0)Pr(Z=0)$ + $Pr(Y|Z=1)Pr(Z=1)$ = $X_1*\alpha$ + $X_2*(1- \alpha)$.
For part b), $E(Y|X_1)$ = $\alpha$?
For (a), note that $|Y|\leqslant|X_1|+|X_2|$ almost surely.
For (b), note that $Y=X_1\mathbf 1_{Z=1}+X_2\mathbf 1_{Z=0}$ and that $X_1$ is a measurable function of $X_1$ while $\mathbf 1_{Z=1}$ and $X_2\mathbf 1_{Z=0}$ are independent of $X_1$. Hence, $$ E(Y\mid X_1)=X_1E(\mathbf 1_{Z=1})+E(X_2\mathbf 1_{Z=0}). $$ Furthermore, $X_2$ and $\mathbf 1_{Z=0}$ are independent and $E(\mathbf 1_{Z=k})=P(Z=k)$ for every $k$ hence $$ E(Y\mid X_1)=X_1P(Z=1)+E(X_2)P(Z=0). $$