# Conditional expectation using conditional PDF

The joint probability density function for two random variables X and Y is given by $$f_{XY}(x,y)=1$$ $$(0.

and the conditional joint PDF is $$f_{XY}(x,y | X>Y)=2$$ $$(0 by bayes' theorem.

Thus, the conditional marginal PDF is $$f_{X}(x | X>Y)= \int_{0}^y 2dy=2x$$ $$(0

I'd like to calculate the conditional expectation and I have a little confusion here : whether I should use $$E(X|X>Y)=\int_{0}^12xdx$$ or $$E(X|X>Y)=\int_{y}^12xdx$$.

• So the joint distribution of $X$ and $Y$ is given by $f_{X,Y}(x,y)= \mathbb{1}_{0<x<1}\mathbb{1}_{0<y<1}$ and $f_X(x) = \int f_{X,Y}(x,y)dy$. We know that $E[X|X>Y]=\frac{E[X\mathbb{1}_{X>Y}]}{P(X>Y)}$. I think you have all the ingredients to compute the expectation. – Sesame May 30 at 10:41
• How does E[X|X>Y]=E[X|X>Y]P(X>Y) hold? It doesn't make sense. – i9100 May 30 at 12:18
• Look at this link – Sesame May 30 at 12:58
• You are overthinking. What you have is two independent $U(0,1)$ variables. See math.stackexchange.com/a/3006539/321264, which is in the same spirit as the answer below. – StubbornAtom May 30 at 16:11

We know that $$E[X|X>Y]=\frac{E[X\mathbb{1}_{X>Y}]}{P(X>Y)}$$. Therefore, \begin{align} E[X|X>Y] &= \frac{E[X\mathbb{1}_{X>Y}]}{P(X>Y)} \\ &=\frac{\int_0^1\int_0^1x\mathbb{1}_{x\geq y}dxdy}{\int_0^1\int_0^1\mathbb{1}_{x\geq y}dxdy} \\ &= \frac23 \end{align}
• (+1) It is enough to directly say $P(X>Y)=1/2$ using symmetry. – StubbornAtom May 30 at 16:14