# Simple question about finding conditional expectation

Let $X,Y \sim U[0,1]$ ($X,Y$ are independent), we want to find $E[X|X>Y].$

I tried a few approaches to the above problem, but am not confident in my answer. One approach is as follows. Note that

$$f_{x|y}(x)=\frac{f_{xy}(x,y)}{f_{y}(y)}=1, x\in [0,1].$$

Hence

$$E[X|X>Y] = \int_{y}^{1}xdx = \frac{1-y^2}{2}.$$

My above answer is a function of $y$, and hence is not making sense to me.

Note: I put my latest thoughts on the question in the comments below glens post, can someone confirm if I am correct or not?

• How do you get from $E[X|X>Y]$ to $\int_{x>y} xf_{x|y}dx$? Feb 17, 2015 at 5:21
• @Glen_b I thought that is how I would compute the conditional expectation in this case. If this is not the correct logic, what would be? Feb 17, 2015 at 5:50
• Who knows, maybe you could be right, or nearly right after a small addition... assume I know nothing at all (which usually isn't so very far off) -- what facts led you to think that? If you show the reasoning, it may be easier to identify what information you need. Feb 17, 2015 at 6:21
• I'd strongly suggest you draw (in the x-y plane) the region where f(x,y) is nonzero, then the region being conditioned on. If we take a completely elementary view, can you see how to work out the conditional density of $(X|X>Y)$? Feb 17, 2015 at 6:32
• The intuition for what I did came from how we compute expectations that look like $E[X|Y=k],$ where $k$ is a constant. So I was following the same approach here. Feb 17, 2015 at 7:24

I'd strongly suggest you draw (in the x-y plane) the region where f(x,y) is nonzero, then the region being conditioned on. If we take a completely elementary view (attempting to rely on only a very few facts), can you see how to work out the conditional density of $(X|X>Y)$? Indeed the drawing tells you immediately (that the density must be $2x$, for $0<x<1$ and 0 elsewhere, since the purple not only shows you the region, but also the conditional density, because the bivariate density is constant within the region) -- can you show (perhaps using facts about conditional density) that the conditional density is indeed $2x$ where it's nonzero?

Once you have that, the expectation should be easy.

• I never thought of treating (X|X>Y) itself as a random variable, that seems like a good idea. Its makes sense for conditional density to be 2x, but I am getting $$f_{x|x>y} = \frac{f_{xy}}{f_{y<x}} = \frac{1}{1/x} = x, x \in [0,1].$$ I know final answer does not make sense (does not integrate to 1 over support), but not sure where the calculation is wrong. Feb 17, 2015 at 7:18
• Does the last example in this section help you to see where you're going astray? Feb 17, 2015 at 7:36
• Alternatively, if I did something totally handwavy and pretended we're working with conditional probabilities: $$P(x<X<x+dx|X>Y) = P(X>Y|x<X<x+dx)P(x<X<x+dx)/P(X>Y) = P(X>Y|X=x)dx/(0.5)$$ Would that be enough to motivate a way to do it properly? Feb 17, 2015 at 7:53
• I looked at the example, and see that my logic does not apply there. Would be $f_{y<x} = 1/2$ since that is the mass where $y<x$? For your conditional probability above, I am not sure how equality holds at the last step. In particular, how does the $P(X>Y)$ in denominator cancel? Feb 17, 2015 at 20:14
• Does the following make sense? $$F_{xy}(x,y) = P(X\le x)P(Y\le x) = x^2$$ but since we need $x>y, F_{x \cap y<x}(x,y) = x^2/2.$ Hence, $$f_{x \cap y<x}(x,y) = x.$$ Similarly since $F_{y}(y) = y,$ implies $F_{y<x}(y) = y/2,$ which implies $f_{y<x}(y) = 1/2.$ Therefore $f_{x|x>y} = 2x,$ then the conditional expectation above would be $2/3?$ Feb 17, 2015 at 20:40