Suppose $X, Y$ have joint density
$f(x, y) = \cfrac{1}{16}$ if $−2 ≤ x ≤ 2$ and $−2 ≤ y ≤ 2$
and $f(x,y) = 0$ otherwise.
Find $P(|X-Y|\leq 1)$
I was told that the fist step to deal with a problem like this is to find the "support set" the set of $(x,y)$ that is desirable.
So I wrote that the support set is {$(x,y): |X-Y| \leq 1$} = {$(x,y): -1\leq X-Y \leq 1$} = {$(X,Y) = X-1 \leq Y \leq X+1$}.
So $P(|X-Y|\leq 1)$ asks us to calculate the probability between $y = x-1$ and $y = x+1$
So $P(|X-Y|\leq 1) = \int_{-2}^1\int_{x-1}^{x+1}\cfrac{1}{16}dydx$ but because we have to account for the constraints $−2 ≤ x ≤ 2$ and $−2 ≤ y ≤ 2$ (which makes the desired region not symmetrical we have to stop at $1$ for the 1st integral and have another integral for $1 \leq x \leq 2$) so I think I need to add $\int_1^2\int_{x-1}^2 \cfrac{1}{16}dydx$ to account for the asymmetrical region.
So in conclusion, $P(|X-Y|\leq 1) = \int_{-2}^1\int_{x-1}^{x+1}\cfrac{1}{16}dydx + \int_1^2\int_{x-1}^2 \cfrac{1}{16}dydx$
Do I have this correct? If not what's wrong with my line of thinking? Can someone lend me a hand? Thank You!
You can check your calculation by looking at the correct answer.
A few things I found:
Denote the set $A=\{(x,y):|x-y|\le 1\}$. The probability $$ P(|X-Y|\le 1) = \iint_A f(x,y)dxdy=\frac1{16} \textrm{Area}(A\cap Q) $$ where $Q=[-2,2]\times[-2,2]$.
It is easy to see from a picture that
$$ \textrm{Area}(A\cap Q)=16-3\cdot 3=7 $$ So the answer if $\frac{7}{16}$.