0

Assume that $X$ and $Y$ are uniform random variables of the uniform distribution on $[0, 1]$.

Then $E(X) = 0.5$, since the $E(X)$ is the mean which is $$ E(X) = \frac{1+0}{2} $$

My intuitive assumption for $E(\left|X - Y\right|)$ was $0$, since $E(X) = E(Y) = 0.5$ but this is not the case.

So solving for $E(\left|X-Y\right|)$ in calculus is equivalent to the double integral

$$ E(|X-Y|) = \int_{0}^{1}\int_{0}^{1}\left|x-y\right|\,\mathrm dx\,\mathrm dy $$

I read that it can be solved using symmetry like

$$ 2I = E(\left|X-Y\right|) + E(\left|Y-X\right|) $$

but I am not sure how to proceed from the point where I have to remove the absolute sign. Can someone help me integrate this expression or correct my reasoning if it is faulty?

Edit: fixing the notation to E(X) instead of E(x) as pointed out

devssh
  • 117

1 Answers1

1

$E|x-y| =\int_0^{1}\int_x^{1} (y-x)\, dy\, dx+\int_0^{1}\int_0^{x} (x-y)\, dy\, dx$. I will let you do the calculations. Symmetry can be used to get the value of the second term from the first: the two terms are equal.

  • 1
    I have used the same symbols for the random variables and the variables of integration (as done by OP) which is not good, but hopefully doesn't confuse anyone -:) – Kavi Rama Murthy Feb 19 '19 at 10:27
  • I tried to solve the integral you gave, it results in solution of -x, which I don't understand as I thought the solution was a finite number. Why are the limits from x to 1 and 0 to x? Can you solve the steps in between, I tried to solve it twice unsuccessfully without a finite number as answer. – devssh Feb 19 '19 at 11:04
  • I thought the x terms would get cancelled out leaving a finite value behind but one remained in the end, the x squared terms did cancel out though. – devssh Feb 19 '19 at 11:10
  • 1
    @devssh Each of the two terms in my answer has the value $\frac 1 6$ , so $E|x-y|=\frac 1 3$. – Kavi Rama Murthy Feb 19 '19 at 11:48
  • Nice, so I understand that to solve for |x-y| we consider it as + or - ( x - y ), and the sum of integral 0 to x and x to 1 is the total area under 0 to 1. Makes sense. – devssh Feb 19 '19 at 13:39