I'm working through a probability text, and one seemingly simple problem is throwing me:
f(x,y) = 2, if 0<y<x, 0<x<1
f(x,y) = 0, otherwise
Find E(X|Y=y)
I thought of the domain restriction as $0<y<x<1$ to better show $x$ as also restricted. First I calculated $f_y(y)=\int_y^12dx=2-2y$, for $0<y<1$. With that result, I found the conditional probability density: $f_{x|y}(x|y)=f(x,y)/f_y(y)=2/(2-2y)=1/(1-y)$, for $0<y<x<1$.
It seems like it should then be straightfoward to calculate $E(X|Y=y)=\int_0^1x*(1/1-y)dx=.5x^2/(1-y)|_0^1=1/(2-2y)$, for $0<y<1$. However, the text tells me that I should be getting $(1+y)/2$, for $0<y<1$.
This is placed in the text as a simple throwaway problem, but I've reworked it a number of times now. What am I doing wrong?
Finally figured it out: the last integral must be from y to 1, rather than from 0 to 1. The domain restriction can't be forgotten just because it has already been used once. The answer then matches that of the text.