I'm currently studying for an upcoming probability exam and I got my hands on one of the previous exams for the course from a friend. I was working my way through it but the following question stumped me :
Suppose that X has a continuous distribution with probability density function given by :$$ f(x) = \begin{cases} \ 2x & 0<x<1,\\ 0 & \text{otherwise}. \end{cases} $$ Suppose that Y is a continuous random variable such that the conditional distribution of Y given X = x is uniform(0, x). Find E(Y).
I've tried using the law of total expectation and finding E(E(Y|X)) to find E(Y) but from what I understand the integral would be $$\int_0^x y \times\frac1x dy = 1$$ However, the possible answers I was given are $\frac12, \frac13, \frac14, \frac23$. I'm not sure where I went wrong since it seemed straightforward enough for me. Could someone explain what I'm missing?
We have \begin{align} E[Y|X] &= \frac{X}2 \end{align}
Hence $E[Y] = \int_0^1 f(x)\cdot \frac{x}{2}\,dx$. Try to evaluate this quantity.