SOLUTION: If the joint pdf of two variables X and Y is f(x,y) = 1/2, 0 <= y <= x, 0 <= x <= 2. Find E[ |Y-X| ]. I have found E[2X+Y] = 10/3 and E[3X^2+Y^3] = 34/5 I think I have

Algebra ->  Probability-and-statistics -> SOLUTION: If the joint pdf of two variables X and Y is f(x,y) = 1/2, 0 <= y <= x, 0 <= x <= 2. Find E[ |Y-X| ]. I have found E[2X+Y] = 10/3 and E[3X^2+Y^3] = 34/5 I think I have      Log On


   



Question 1171015: If the joint pdf of two variables X and Y is
f(x,y) = 1/2, 0 <= y <= x, 0 <= x <= 2.
Find E[ |Y-X| ].
I have found E[2X+Y] = 10/3 and E[3X^2+Y^3] = 34/5
I think I have to set up two double integrals and add up their values.
My issue is what the bounds would be when y > x.

Answer by CPhill(1959) About Me  (Show Source):
You can put this solution on YOUR website!
Let's find the expected value of $|Y - X|$ given the joint pdf $f(x, y) = \frac{1}{2}$ for $0 \le y \le x$ and $0 \le x \le 2$.
**1. Set up the Integral**
We need to compute the integral:
$$E[|Y - X|] = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} |y - x| f(x, y) \, dy \, dx$$
Given the bounds, we have:
$$E[|Y - X|] = \int_{0}^{2} \int_{0}^{x} |y - x| \cdot \frac{1}{2} \, dy \, dx$$
**2. Simplify the Absolute Value**
Since $y \le x$, we have $y - x \le 0$, so $|y - x| = -(y - x) = x - y$.
$$E[|Y - X|] = \int_{0}^{2} \int_{0}^{x} (x - y) \cdot \frac{1}{2} \, dy \, dx$$
**3. Evaluate the Inner Integral**
$$\int_{0}^{x} (x - y) \, dy = \left[xy - \frac{y^2}{2}\right]_{0}^{x} = x^2 - \frac{x^2}{2} = \frac{x^2}{2}$$
**4. Evaluate the Outer Integral**
$$E[|Y - X|] = \int_{0}^{2} \frac{x^2}{2} \cdot \frac{1}{2} \, dx = \frac{1}{4} \int_{0}^{2} x^2 \, dx = \frac{1}{4} \left[\frac{x^3}{3}\right]_{0}^{2} = \frac{1}{4} \cdot \frac{8}{3} = \frac{2}{3}$$
**Therefore, E[|Y - X|] = 2/3.**