Let $X,Y$ be two independent random variables with a uniform distribution on the unit interval. The questions first asks for $E(X^k)$ where $k$ is some fixed constant that is at least 0. This calculation is easy, as it is just $$\int_{0}^{1}x^{k}f_X(x)dx = \frac{1}{k+1}$$ Now, the question gets slightly trickier, and this is where my understanding of conditional expectation and conditional probability gets fuzzy. The question asks: what is $E(X^Y)$.? A hint is given, saying to use the tower law, i.e the fact that $E(X) = E(E(X|Y)) $.
First, I am not sure what the inner expectation means. Most textbooks say it is a function of $Y$, which makes sense, but is not completely sound to me. Setting up this particular example with the tower law, we have:
$$E(X^Y) = E(E(X^Y|Y))$$ After this I am somewhat stuck. I attempted to use the following: $$E(X^Y|Y) = \int_{0}^{\infty}yf_{X^Y|Y}(x,y)dy$$ but I am fairly unsure as to what this statement actually means . If someone could help me develop a better understanding of conditional expectation of R.Vs and conditional probability in general, I would appreciate it, moreso than just an answer to this question.
You are trying to compute $$E(X^Y) = \int_{0}^{1}\int_{0}^{1}x^yf_{XY}(x,y)dx dy. \tag 1$$ But $f(x,y)=f(x|y)f(y)$. Therefore, $$E(X^Y) = \int_{0}^{1}\left(\color{red}{\int_{0}^{1}x^yf_{X|Y}(x;y)dx}\right) f_{Y}(y)dy. \tag 2$$ The red integral in $(2)$ is $E(X^y)=E(X^Y|Y=y)$ for short.
Consequently, $E(X^Y)=E(E(X^Y|Y))$, where the outer expectation is w.r.t. $Y$ as done in $(2)$.
In your case, $f_{X|Y}(x;y)=f_{X}(x)$. So $E(X^Y|Y)=\frac{1}{y+1}$. As such, $$E(X^Y) = \int_{0}^{1}\frac{1}{y+1}f_{Y}(y)dy = ? \tag 3$$