[Math] Probability that distance between $X$ and $Y$ is $>$ $L/3$

probability

Two points are selected randomly on a line of length $L$, so as to be on opposite sides of the midpoint of the line[In other words, the two points $X$ and $Y$ are independent random variables with a uniform distribution over $(0, L/2)$ and $(L/2, L)$ respectively.
Find the probability that the distance between the two points is greater than $L/3$.

Attempt: We have $f_X(x) = f_Y(y) = 2/L => f(x,y) = 4/L^2 $ The probability I want is $P(Y-X > L/3) = P(Y> L/3 + X)$. So I need to evaluate: $$ \iint_{(x,y): y > L/3 + x} f(x,y)\,dy\,dx.$$ I said the limits on $y$ were from $L/3 + x$ to $L$ and $x$ from $0$ to $L/2$, so I evaluate $$\int_0^{L/2} \int_{L/3 +x}^{L} \frac{4}{L^2}\,dy\,dx$$ which gives $5/6$, but that is incorrect. Where did I go wrong?

Best Answer

Since you are integrating a constant function, it's going to be so much easier if you draw yourself a picture of the area and use simple geometry, rather than integrating an analytic expression:

enter image description here

And dividing the hatched area by the total square area, the resulting probability is $\frac{7}{36}/\frac{1}{4} = \frac{7}{9}$