Absolute difference of two Uniform random variables. Let $X$ and $Y$ be two independent random variables following a uniform distribution $[0,5]$
Determine $P(|X-Y| \leq 1).$
What i tried:
$f_{x}(x) = \begin{cases}
\frac{1}{5}, & \text{0}\leq x \leq\text{5} \\
0, & \text{otherwise}
\end{cases}$
$f_{y}(y) = \begin{cases}
\frac{1}{5}, & \text{0}\leq y \leq\text{5} \\
0, & \text{otherwise}
\end{cases}$
Sine $X$ and $Y$ are independent , we can get the joint distribution $f_{xy}(x,y)=f_{x}(x)f_{y}(y)$
Hence : 
$f_{xy}(x.y) = \begin{cases}
\frac{1}{25}, & \text{0}\leq x \leq\text{5} & \text{0}\leq y \leq\text{5}  \\
0, & \text{otherwise}
\end{cases}$
$P(|X−Y|≤1)=P(-1<X−Y≤1)=P(X-Y \leq1)-P(X-Y\leq-1)$.
$P(X-Y\leq1)=P(X\leq1+Y)=1-P(X\geq1+Y=1-\int_{1}^{4}\int_{0}^{x-1}\frac{1}{25}dydx =\frac{17}{25}$
Similarly : 
$P(X-Y\leq-1)=P(X\leq Y-1)=\int_{1}^{4}\int_{x+1}^{5}\frac{1}{25}dydx=\frac{9}{50}.$
Then $P(|X−Y|≤1)=\frac{17}{25}-\frac{9}{50}=\frac{1}{2}$
However the right answer seems to be $\frac{1}{5}$
What am i doing wrong?
 A: There are two errors in your calculations. One is that you incorrectly evaluated the first integral, which comes out as $1-\frac9{50}$, since by symmetry it must be the complement of the other integral. The other one is that the integrals over $x$ should be over $[1,5]$, not $[1,4]$. If you fix these mistakes, you arrive at $\frac9{25}$, the solution that was already discussed in the comments.
A: Comments: 
(1) A simulation in R consistent with $P(|X - Y| \le 1) = 9/25:$
With a million iterations, the simulated result should be accurate to
two places. (Similar to the one in @JimB's Comment.)
set.seed(701);  m = 10^6
x = runif(m, 0, 5);  y = runif(m, 0, 5)
w = abs(x - y)
mean(w);  sd(w)
## 1.665504    # aprx E(W)
## 1.178755    # aprx SD(W)
mean(w <= 1); 9/25
## 0.360622    # aprx P(W < 1)
## 0.36


(2) Because $(X,Y)$ is jointly uniform over the square with vertices $(0,0)$
and $(5,5),$ it is possible to find the desired probability using geometry.
With a little algebra, one can find the region of the square that
results in $|X-Y| \le 1.$ This is the green region in the plot below,
made using the first 50,000 points simulated above. (See Comments by
@SteveKass and @dEmigOd.)
mm = 50000; X = x[1:mm]; Y = y[1:mm];  cond = abs(X - Y) <= 1
plot(X,Y, pch=".");  points(X[cond], Y[cond], pch=".", col="green2")


