Calculate $P(|X-Y| \leq 0.25)$

99 Views Asked by At

How do I calculate $P(|X-Y| \leq 0.25)$ where $X,Y \sim U([0,1])$?

I figured out that if $X \in [0,0.25]$, then $P(Y \leq X+0.5) = X+0.25$, if $X \in [0.25, 0.5]$, then $P(|X-Y| \leq 0.25 \ | \ X \in [0.25,5]) = 0.5$ and $P(|X-Y| \leq 0.25 \ | \ X \in [0.5,1]) = 1.25-X$.

How do I proceed from here?

1

There are 1 best solutions below

0
On BEST ANSWER

From the question it seems that $X$ and $Y$ are independent, so the joint density function is $f(x,y) = f_X(x) f_Y(y) = 1 \times 1 =1$. Now $|X-Y| < 0.25 \Rightarrow -0.25 < Y-X < 0.25 \Rightarrow X-0.25 < Y < X+ 0.25$. But note from your graphical picture that when $ X\in [0,0.25]$ then $0 <Y < X+0.25$ and similarly, when $X\in [0.75,1]$ then $X-0.25<Y<1$ (Since for negative $y$ or $y$ bigger than 1, $f_Y(y) = 0$ and we can ignore them). Now

$$ \begin{align} P(|X-Y| < 0.25) & = \int_0^1 \int_{x - 0.25}^{x + 0.25} f(x,y) dy dx\\ & = \int_0^{0.25} \int_{0}^{x + 0.25} dy dx +\int_{0.25}^{0.75} \int_{x-0.25}^{x + 0.25} dy dx +\int_{0.75}^1 \int_{x-0.25}^{1} dy dx\\ & = 7/16 \end{align} $$