# Solution to a problem is not satisfying me (probability, continuous).

Problem and solution.

(the way I understood the solution) The condition is manipulated so as to represent it in a graphical way that allows one to find the area of the CDF.

My problem is, I find the method used here quite ad hoc; what if you're in 4 dimensions instead of 2? Basically what I'm asking is how could one find the formula for the area analytically, instead of graphically? I have spent some time thinking about it myself but with no success.

$X$ and $Y$ are random locations. The distance in this one-dimensional problem is simply the random variable $|X-Y|$. In a more general problem, $X$ and $Y$ would be random vectors and the distance simply the distance (perhaps euclidean) between the vectors $d(X,Y)$. This distance is itself a one-dimensional random variable. The distribution of this random variable can be found using the distributions of $X$ and $Y$. See these notes on finding distributions of functions of two random variables.