How to compute the limits for this uniform distribution problem?

487 Views Asked by At

I am trying to solve the following probability problem which involves uniform distribution:

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, its distance 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, compute, assuming independence, the distribution of its distance from the accident.

The following is the suggested solution:

$$ \begin{aligned} \text{Let } z &= |X-Y|, \\ \\ F_Z(z) &= P(|X-Y|<z) = P(-z<X-Y<z) \\ &=\int_0^L{P(y-z<X<y+z|Y=y)f_Y(y)}dy \\ &=\int_0^L{P(y-z<X<y+z)f_Y(y)}dy \\ &=\int_0^L{[F_X(y+z)-F_X(y-z)]f_Y(y)}dy \\ &=\int_0^z{\frac{(y+z)}{L}\frac{1}{L}}dy + \int_z^{L-z}{\frac{2z}{L}\frac{1}{L}}dy + \int_{L-z}^L{\frac{L+z-y}{L}\frac{1}{L}}dy \\ &=\cdots \end{aligned} $$

Problem source: here

I don't understand how the solution derived the limits for the sum of 3 integrals in the last step (as shown above). I also do not understand how they derived the terms for the 3 integrals from the second last step. Could someone please explain these to me?

1

There are 1 best solutions below

3
On BEST ANSWER

First, note that $0\leq |X-Y|\leq L$, and therefore $$F_Z(z) = P(|X-Y|<z)=\begin{cases}0, & z\leq 0\\ P(-z<X-Y<z), & 0<z\leq L\\ 1, & z>L\end{cases}$$ So, the next calculations are for $0<z\leq L$ only: \begin{aligned} F_Z(z) &= P(|X-Y|<z) = P(-z<X-Y<z) \\ &=\int_0^L{P(y-z<X<y+z|Y=y)f_Y(y)}dy \\ &=\int_0^L{P(y-z<X<y+z)f_Y(y)}dy \\ &=\int_0^L{[F_X(y+z)-F_X(y-z)]f_Y(y)}dy \end{aligned} For $y,z\in(0,L]$ write both $F_X(y+z)$ and $F_X(y-z)$: $$F_X(y+z)=\begin{cases}\frac{y+z}{L}, & 0<y+z\leq L\\ 1, & y+z>L\end{cases}=\begin{cases}\frac{y+z}{L}, & 0<y\leq L-z\\ 1, & L-z<y\leq L\end{cases} $$ $$F_X(y-z)=\begin{cases}0, & y-z\leq 0\\ \frac{y-z}{L}, & 0<y-z\leq L\end{cases}=\begin{cases}0, & 0<y\leq z\\ \frac{y-z}{L}, & z<y\leq L\end{cases} $$ For the case when $z<L-z$ or $z<L/2$, the interval $(0,L]$ is divided into three parts $$(0,L]=(0,z]\cup(z,L-z]\cup(L-z,L].$$ And the difference of this functions equals $$ F_X(y+z)-F_X(y-z) = \begin{cases}\frac{y+z}{L}-0, & 0<y\leq z\\ \frac{y+z}{L}-\frac{y-z}{L}, & z<y\leq L-z\\ 1 - \frac{y-z}{L}, & L-z<y\leq L\end{cases} $$ The integrals below are just integrals over these regions: \begin{aligned} F_Z(z) &=\int_0^L{[F_X(y+z)-F_X(y-z)]f_Y(y)}dy \\ &=\int_0^z{\frac{(y+z)}{L}\frac{1}{L}}dy + \int_z^{L-z}{\frac{2z}{L}\frac{1}{L}}dy + \int_{L-z}^L{\frac{L+z-y}{L}\frac{1}{L}}dy \\ &=\cdots \end{aligned}

For the case when $z> L-z$ or $z>L/2$, the difference $F_X(y+z)-F_X(y-z)$ looks quite different: $$ F_X(y+z)-F_X(y-z) = \begin{cases}\frac{y+z}{L}-0, & 0<y\leq L-z\\ 1-0, & L-z<y\leq z\\ 1 - \frac{y-z}{L}, & z<y\leq L\end{cases} $$ And the integrals will be \begin{aligned} F_Z(z) &=\int_0^L{[F_X(y+z)-F_X(y-z)]f_Y(y)}dy \\ &=\int_0^{L-z}{\frac{(y+z)}{L}\frac{1}{L}}dy + \int^z_{L-z}{\frac{1}{L}}dy + \int_{z}^L{\frac{L+z-y}{L}\frac{1}{L}}dy \\ &=\cdots \end{aligned} Fortunately, the result will be the same as for the first case, but...

Let me also note that the distribution of this r.v. can be obtained without integration, from geometric probability. See https://math.stackexchange.com/a/1340913/413376 for example.