Suppose $X∼ U(0,1)$ and that conditional on $X$ being observed, $Y|X =x ∼ U(0,x)$. Calculate $E[Y]$.
To find $E[Y]$, I would like to use the proposition in my textbook that says $E[Y]=E[E[Y|X]]$.
However, I get that $E[Y|X] = \int_{0}^xxf(y|x)dx=\int_{0}^xx(1/x)dx=x$, while my professor told us that $E[Y|X]$ should equal $x/2$.
Could someone tell me what I did wrong? Thank you
Also, how would you find $var(Y|X)$?
The PDF for a $U(0,x)$ random variable is $1/x.$
Hence,
$$E[Y|X=x] = \int_0^x t (1/x) \, dt = x/2.$$