Why can't I use linearity of conditional expectation?

46 Views Asked by At

I saw this question on which asks:

Let ∼(0,1) and ∼(0,2) be independent random variables. What's the expected value of |−| ?

I understand the provided solution, but I was wondering why this method below, which uses linearity of conditional expectation, doesn't work: \begin{align} E[|X-Y|]&=E[X-Y|X>Y]\\ &=\int_0^2E[X-Y|X>Y,Y=y]f(y)dy\\ &=\frac{1}{2}\int_0^2E[X-Y|X>Y,Y=y]dy\\ &=\frac{1}{2}\int_0^2(E[X|X>Y,Y=y]-E[Y|X>Y,Y=y])dy\\ &=\frac{1}{2}\int_0^2\left(\frac{2+y}{2}-y\right)dy\\ &=1/2. \end{align} Which differs from the correct answer, 1/3.

1

There are 1 best solutions below

2
On

Your first line is incorrect, using the law of total expectation it should read $$E[|X-Y|] = E[X-Y|X > Y]P(X > Y) + E[Y-X|Y > X]P(Y > X).$$