# Uniform distribution probability calculation

Here is an exam problem with the work shown:

A man and a woman agree to meet at a certain location at about 12:30 pm. The man will arrive at a time uniformly distributed between 12:15 and 12:45, and the woman will arrive at a time uniformly distributed between 12:00 and 1:00. Find the probability that the first to arrive has to wait no longer than 10 minutes.

Solution: Let $X$ be the time man arrives and $Y$ the time the woman arrives. We may assume that $X$ is uniform on $(15,45)$ and $Y$ uniform on $(0,60)$. We know that $X$ and $Y$ are independent. By drawing a picture and calculating the areas of appropriate regions we can conclude that the desired probability is $\frac23$.

Alternatively, by using that the joint density of $X$ and $Y$ is $\frac13\times\frac1{60}=\frac1{1800}$, we can compute \begin{align}\mathbb P(|X-Y|\le10)&=\color{blue}{\mathbb P(-10\le Y-X\le10)=\int_{15}^{45}\int_{x-10}^{x+10}}\frac1{1800}\,\mathrm dy\,\mathrm dx\\&=\frac1{1800}\int_{15}^{45}20=\frac1{1800}20\times30=\frac13\end{align}

I am extremely confused by the step that I circled. How did it change to $Y-X$, not $X-Y$?

This is my work:

Let $x$ denote the time at which the man arrives. Let $y$ denote the time at which the woman arrives.

$$x-y\le10,y-x\le10\to|x-y|\le10$$

\begin{align} \mathbb P(|X-Y|\le10)&=\mathbb P(-10\le Y-X\le10)\\ &=\int_0^{60}\int_{y-10}^{y+10}\left(\frac1{30}\right)\left(\frac1{60}\right)\,\mathrm dx\,\mathrm dy\\ &=\int_0^{60}\left(\left[\frac1{1800}x\right]_{x=(y+10)}-\left[\frac1{1800}x\right]_{x=(y-10)}\right)\,\mathrm dy\\ &=\int_0^{60}\left[\frac{y+10}{1800}-\frac{y-10}{1800}\right]\,\mathrm dy\\ &=\int_0^{60}\left[\frac{20}{1800}\right]\,\mathrm dy\\ &=\frac1{90}\int_0^{60}1\,\mathrm dy\\ &=\frac{60}{90}\\ &=\frac23 \end{align}

I get $\frac23$, the professor gets $\frac13$ (but also says above it is $\frac13$?)

• I would ignore the part of the solution starting with "Alternatively." There are multiple errors and the first solution, $\frac23$, is correct. Commented Nov 13, 2015 at 3:12
• Also, recall that $|a|<b$ if and only if $a<b$ and $-a<b$. Commented Nov 13, 2015 at 3:21
• Here is a Wolfram|Alpha result that will show the the region in question (note that I am using minutes as units instead of hours) wolframalpha.com/input/… Commented Nov 13, 2015 at 3:24
• Thank you! I knew there was something wrong. Commented Nov 13, 2015 at 3:41

Note that, because $\mathsf P(\lvert X-Y\rvert \leq 10) = \mathsf P(\rvert Y-X\lvert \leq 10)$ , therefore it could go either way.

They chose to use $\mathsf P(-10\leq Y-X\leq 10)$ since that displays how they obtained the bounds for their inner integral.   Here's what they did with a few more steps for clarity.

\begin{align} \mathsf P(-10\leq Y-X\leq 10) & = \int_{15}^{45}\mathsf P(x-10\leq Y\leq x+10\mid X=x)f_X(x)\operatorname d x \\[1ex] & = \int_{10}^{45}\int_{\max\{0,x-10\}}^{\min\{60,x+10\}} f_{X}(x)f_{Y}(y)\operatorname d y\operatorname d x & \star \\[1ex] & = \int_{10}^{45}\int_{x-10}^{x+10} \frac 1{45-10}\cdot\frac1{60-0}\operatorname d y\operatorname d x \\[1ex] & = \frac{45-10}{45-10}\cdot \frac{20}{60} \\[2ex] & = \frac 1 3 \end{align}

Note: I included the $\max$ and $\min$ functions on the line marked $\star$ as a reminder to beware that the bounds don't exceed the support, as happens occasionally in these problems.   Fortunately it is not a concern for this problem as all values of $X$ lying more than $10$ minutes inside the boundary of $Y$.   But be careful.

In fact, this seems to be where you went awry.

\begin{align} \mathsf P(-10\leq X-Y\leq 10) & = \int_{15}^{45}\mathsf P(y-10\leq X\leq y+10\mid Y=y)f_Y(y)\operatorname d y \\[1ex] & = \int_{0}^{60}\int_{\max\{15,y-10\}}^{\min\{45,y+10\}} f_{X}(x)f_{Y}(y)\operatorname d x\operatorname d y & \star \\[1ex] & = \int_0^{25}\int_{15}^{y+10}\frac 1{30}\frac 1{60} \operatorname d x\operatorname d y + \int_{25}^{30}\int_{y-10}^{y+10} \frac 1{30}\frac1{60}\operatorname d x\operatorname d y + \int_{30}^{60}\int_{y-10}^{45}\frac 1{30}\frac1{60}\operatorname d x\operatorname d y \\[2ex] & = \frac 1 3 \end{align}

• Thank you, this is amazing. Commented Nov 13, 2015 at 5:07