Conditional expectations $E\left(X^Y\mid X\right)$ and $E\left(X^Y\mid Y\right)$ 
Let $X,Y$ be independent random variables. $X$ has uniform distribution on $[0,1]$ and $Y$ has uniform distribution on $\{0,1\}$. Find $E\left(X^{Y}\mid X\right)$ and $E\left(X^{Y}\mid Y\right)$.

Both $E\left(X^{Y}\mid X\right)$ and $E\left(X^{Y}\mid Y\right)$ are random variables. My questions are:


*

*is $X^{Y}$ measurable on $\sigma-$algebra generated by $X$ and

*is $E\left(X^{Y}\mid Y\right)$ a discrete random variable?

 A: *

*The smallest $σ$-algebra on which $X^Y$ is measurable is $σ\left(X^Y\right)$, defined as
$$σ\left(X^Y\right)=\left(X^Y\right)^{−1} \mathcal B(\mathbb R)=\left\{\{X^Y\in B\}\subset Ω:B\in \mathcal B(\mathbb R)\right\}$$ Now, take the set $B_1:=\{1\}\in \mathcal B(\mathbb R)$ with $$\left(X^Y\right)^{-1}B_1=\left\{ω\in Ω: X^Y(ω)=1\right\}=\{ω\inΩ: Y(ω)=0 \text{ or } X(ω)=1\}$$ A $σ$-algebra generated by $X$ does not contain the information $Y(ω)=0$ and hence $X^Y$ is not measurable with respect to it. 

*Observe that $$E\left(X^Y\mid Y=1\right)=E\left(X^1\right)=\frac12, \qquad E\left(X^Y\mid Y=0\right)=1$$ (ok, let $0^0=1$ or let $X\sim U(0,1)$ to avoid complications), and putting these two together with the help of indicator functions $$E\left(X^Y\mid Y\right)=1-\frac12\mathbf1_{\{Y=1\}}$$ and hence it is discrete (it takes the values $\frac12$ and $1$).

A: Since $X,Y$ are independent and $Y\sim\mathcal U\{0,1\}$ therefore:
$$\mathsf E(g(X,Y)\mid X) = \sum_{t=0}^1 \tfrac 12g(X,t)$$
Since $X,Y$ are independent and $X\sim\mathcal U[0;1]$ therefore:
$$\mathsf E(g(X,Y)\mid Y) = \int_0^1 g(s,Y)\mathrm d s$$
