# Expected value of an expected value of a joint density function

I had a question I was hoping for some help on:

Let $Y_1$ and $Y_2$ be continuous random variables with joint density function:

$$f(x,y) = \begin{cases} 6(1-y_2) & \text{if 0 <= y_1 <= y_2 <= 1 } \\ 0 & \text{elsewhere} \end{cases}$$

a) Find E[$Y_1|Y_2 = y_2$]

b) Use the answer you found in part a) to find E[E[$Y_1|Y_2 = y_2$]]

I did the work to find that a) is $$\int_{0}^{1}\frac{6(1-y_2)}{6y_2 - 6y_2^2}\ dy_1 = \dfrac{1}{y_2}$$ (If you wouldn't mind checking that answer as seeing my question relies on part b), which in turn relies on a) ). However, I'm not sure at all how to approach b). Would someone assist me? Thank you so much in advance, I really appreciate it!

• I think you meant $f\left(y_1,y_2\right)$ instead of $f\left(x,y\right)$ Commented Feb 1, 2015 at 22:47
• Given $Y_2=y_2$, the joint density is a constant with respect to $y_1$, i.e. $y_1$ is conditionally uniformly distributed on $[0,y_2]$ and so has a conditional density of $\frac1{y_2}$. But this is not the conditional expectation, which is instead $\frac{y_2}{2}$. Commented Feb 1, 2015 at 23:07
• fonini - You are correct, I apologize for the error! Thanks for catching it! Commented Feb 2, 2015 at 1:36
• @Henry - Did I do something wrong? Was my marginal density $6y_2 - 6y_2^2$ wrong? Commented Feb 2, 2015 at 1:39
• $6y_2-6y_2^2$ is the marginal density for $Y_2$ on $[0,1]$, but I do not quite see why you integrate in the way you do, and instead you need to calculate (a) the conditional expectation $\displaystyle \int_{y_1=0}^{y_2} y_1\frac1{y_2}\,dy_1 = \frac{y_2}{2}$. Commented Feb 2, 2015 at 7:11

(a) The marginal density function for $Y_2$: