An ambulance problem involve sum of two independent uniform random variables An ambulance travels back and forth at a constant speed along a road of length $L$. At a certain moment of time, an accident occurs at a point uniformly distributed on the road.[That is, the distance of the point from one of the fixed ends of the road is uniformly distributed over ($0$,$L$).] Assuming that the ambulance's location at the moment of the accident is also uniformly distributed, and assuming independence of the variables, compute the distribution of the distance of the ambulance from the accident.
Here is what I have so far:
$X$ = point where the accident happened
$Y$ = location of the ambulance at the moment.
$D = |X-Y|$, represents the distance between the accident and the ambulance
$P(D \leq d) = $$\mathop{\int\int}_{(x,y)\epsilon C} f(x,y) dx dy$
where $C$ is the set of points where $|X-Y| \leq d$
I'm having trouble setting up the limit for the integral. It would be greatly appreciated if  someone can upload a picture of the area of integration.
 A: We do something far better than uploading. Take a sheet of paper, draw the usual axes. They can be low and to the left, since we will only use part of the first quadrant.
Draw the square with corners $(0,0)$, $(L,0)$, $(L,L)$, and $(0,L)$. The pair $(X,Y)$ live in this square. The joint density is constant in that square, so it is $\frac{1}{L^2}$ in the square and $0$ elsewhere.
Now, for smallish $d$, draw the lines $y=x-d$ and $y=x+d$. The part of the square between these lines is what you called $C$. 
But let's finish the problem. The probability that $D\le d$ is the area of $C$, divided by the area $L^2$ of the whole square.
The region $C$ is a little ugly, but the rest of the square is made up of two nice triangles, which fit together to make a square. It is easy to find the side of that square.
A: Here is a rough sketch of the integration region:

The $x$ and $y$ axes goes between $0$ and $L$.  The "shaded" (for lack of a better word) region represents those $X$ and $Y$ such that $|X-Y| \le d$.
The integration region is split in 3 pieces, which I hope you can see from this admittedly crude diagram:
$$P(|X-Y| \le d) = \frac{1}{L^2} \left [\int_0^d dx \: \int_0^{d+x} dy + \int_d^{L-d} dx \: \int_{-d+x}^{d+x} dy + \int_{L-d}^{L} dx \: \int_{-d+x}^{L} dy \right ]$$
So you can check, the result I get is
$$P(|X-Y| \le d) = \frac{d}{L} \left ( 2 - \frac{d}{L} \right)$$
You can also see it from the difference between the area of the whole region minus the area of the 2 right triangles outside the "shaded" region.
