$P(|X - Y| \leq 1/2)$, $X$ and $Y$ have continuous uniform distribution. 
$X \sim Unif[0, 1]$ and $Y \sim Unif[0, 1]$. $X$ and $Y$ are independent. Determine $P(|X - Y| \leq 1/2)$.

Thoughts:
Let $Z = X - Y$. Then $Z = X + (-Y)\sim Unif[-1, 1]$ with constant pdf = $1/2$. Then, we have $P(|Z| \leq 1/2) = P(0 \leq Z \leq 1/2) = (1/2)^2 =1/4$.
Is this correct? I'm not sure I can determine the distribution of $Z$ so simply.
 A: Comment:  You're on the right track.
The points $(X,Y)$ are uniformly distributed in the square with
vertices at $(0,0)$ and $(1,1).$ In the figure below (drawn using
simulation in R), the blue region shows the proportion of points
with $\{|X - Y| < .5\}.$ Seems to be $3/4.$
x = runif(10^5); y = runif(10^5)  
event = abs(x-y) < 1/2
mean(event)
[1] 0.7492

plot(x,y, pch=".")
  points(x[event],y[event], col="blue", pch=".")
  abline(v = .5, col="red", lwd=2)


Note:: Even though the problem can be solved by using elementary
school algebra and geometry, it may be useful to evaluate
the appropriate double integral. If you do that, it's probably
best to split the interval into two parts--to the left of the
vertical red line and to the right.
A: That's not the way to find the PDF for $Z=X-Y$. The correct way is this: 
$$f_Z(z) = \int_{-\infty}^{\infty} f_X(u+z) f_Y(u) du$$
But as pointed out in the comments, there is an efficient way to do it. Consider the set $[0,1]\times [0,1]$. We want to find the probability of picking a point $(x,y) \in [0,1]\times [0,1]$ such that $|x-y| \le 0.5$. So all you need to do is find the area of the region $|x-y| \le 0.5$ that is inside the square $[0,1]\times [0,1]$ and divide it by the area of the square (which is $1$). 
Edit: This proposition makes sense because the distribution of both $X$ and $Y$ is uniform.
