Two trains are leaving their station, train $X$ does $A\rightarrow B$ and train $Y$ does $B\rightarrow A$. each train leaves at an uniformley distributed time between $12:00$ and $12:30$, independently from each other.
Each train drives for 10 minutes untill arriving at their destination.
What is the probability that there exists a moment where both trains are moving simultaneously?
I've denoted $X$ to be the time train $X$ leaves it's station, and the same for $Y$.
We're looking for a moment $t\in [0,30]$ such that $Y\leq t\leq Y+10$ and $X\leq t\leq X+10$.
In other words, $P(|X-Y|<10)$ Since leaving times are independent, we can exchange this for $P(X-10<Y<X)\cdot P(Y-10<X<Y)$
I'm uncertain on how to progress from here, one of my uncertainties is weather or not I can replace $P(X-10<Y<X)$ for $P(X-10<Y)\cdot P(Y<X)$ and vice versa.
What you want is the area of the blue coloured region below.
That is $30\times 30 - 2\cdot \frac{1}{2}\cdot 20\cdot 20 = 500$ . i.e. (The area of the whole square minus the area of the two triangles in the bottom right and top left)
So the required probability is $\frac{500}{900}=\frac{5}{9}$
To put it more rigourously . You want $P(|X-Y|<10)$ when $X$ , $Y$ $\sim Unif[0,30]$ and are independent.