3

This question had already been answered in this post using geometric interpretation, which was quite insightful. What I'd like to grasp is where I made a mistake in my analytical development of this question. It follows as:

\begin{eqnarray} \\ F_Z(z) &=& P(Z<z)\\ &=& P(|X-Y|<z)\\ &=& P(-z<X-Y<z)\\ &=& P(Y-z<X<z+Y)\\ &=& P(X<z+Y) - P(X<Y-z)\\ &=& F_X(Y+z) - F_X(Y-z)\\ &=& \int_{0}^{1}\!\int_{0}^{y+z}\! f_{X,Y}(x,y) \,\mathrm{d}x{d}y - \int_{0}^{1}\!\int_{0}^{y-z}\! f_{X,Y}(x,y) \,\mathrm{d}x{d}y \end{eqnarray}

Since $X$ and $Y$ are independent random variables

\begin{eqnarray} F_Z(z) &=& \int_{0}^{1}\!\int_{0}^{y+z}\! f_{X}(x)f_{Y}(y) \,\mathrm{d}x{d}y - \int_{0}^{1}\!\int_{0}^{y-z}\! f_{X}(x)f_{Y}(y) \,\mathrm{d}x{d}y\\ \end{eqnarray}

From the uniform distribution, we have $f_X(x) = f_Y(y) = 1$, then

\begin{eqnarray} F_Z(z) &=& \int_{0}^{1}\!\int_{0}^{y+z}\! \,\mathrm{d}x{d}y - \int_{0}^{1}\!\int_{0}^{y-z}\! \,\mathrm{d}x{d}y\\ &=& 2z \end{eqnarray}

Thank you in advance

gx.
  • 47
  • 1
    Does looking at it this way help: $\int _0^1\int _{\max (0,y-z)}^{\min (1,y+z)}dxdy$. – JimB Jun 28 '20 at 04:33
  • https://math.stackexchange.com/q/1681363/321264 – StubbornAtom Jun 28 '20 at 06:27
  • @JimB, I'd like to thank you for your hint, but I must admit that It was not very insightful for a beginner like myself. However, I tried to develop the reasoning about my doubts in my response to Drathora. Would you mind taking a look as well? Another point, besides the conceptual one, is how would I evaluate the integral considering $max$ and $min$ functions as boundaries. I've never come across this. Thank you in advance! – gx. Jun 28 '20 at 13:10

1 Answers1

1

As JimB alluded to above, your problem is that you haven't taken into account some issues with the boundaries of your integrals.

If you look at your attempt at the question, you replace $f_X(x)$ with $1$, even for values of $x=y+z$ that are above $1$. So what you should do is replace $y+z$ with min$(y+z,1)$, as this is equivalent to replacing $f_X(x)$ with $0$ at all values of $x$ higher than 1.

Likewise, in the second integral you replace $f_X(x)$ with $1$, even for values of $x=y-z$ below $0$. So what you should do if replace $y-z$ with max$(y-z,0)$, as this is equivalent to replacing $f_X(x)$ with 0 for all values of $x$ lower than 0.

First inner integral then evaluates to min$(y+z,1)$

Second inner integral then evaluates to max$(y-z,0)$

Then as $z$ is fixed, only the values of $y$ decide on which of these is the min/max. So you can split the outer integrals at these points ($y=1-z$ and $y=z$ respectively), and replace the min/max expressions with the corresponding min/max.

$\int_{1-z}^1 1 \; dy + \int_0^{1-z} y+z \; dy$

Here, the first integral corresponds to all the values of $y$ where $y+z>1$, meaning $x$ is guaranteed to be less than $y+z$, so it makes sense that the inner integral evaluated to $1$. The second integral corresponds to the values of $y$ where $y+z\leq 1$, and here the inner integral behaves as you wrote in your attempt.

Likewise, the second integral can also be split into two parts:

$\int_0^z 0 \; dy + \int_z^1 y-z \; dy$

Again, the left integral corresponds to the values of $y$ where $y-z<0$, meaning that $x$ is guaranteed to be greater than $y-z$, so as expected the inner integral evaluated to $0$ (as the condition can never be met). The right integral corresponds to the values of $y$ where $0\leq y-z$, and in this case the inner integral matches your attempt.

Final things to note are that $z>0$ and $1>y>0$ so $y+z>0$ and $y-z$<1 are guaranteed, so those potential boundary problems can be ignored.

Evaluating these integrals and taking the difference as you do in the expression you wrote above, you'll end up with $2z - z^2$ as required.

Hopefully this helps you understand the mistake you made. You can also just put max and min boundaries on the inner integrals and evaluate like that, but I think this way helps to point out where the mistake in your reasoning was, as you can clearly see that at certain points you're hitting the "top" and "bottom" of the CDF.

  • Firstly, I'd like to thank you for your explanation, it was extremely well constructed. However, I'm starting my journey in probabilities, which means that some concepts may yet not be fully consolidated. I confess that I couldn't fully grasp the boundaries issues, mainly because I can't seem to understand why, for instance, the case $x = y+z > 1$ should be accounted for, since the argument of the CDF is the PDF, which is zero for the cases where the values exceed the boundary $[0,1]$. In that case, I'd expect that breaking the integral would yield one integration over $0$, which was not seen. – gx. Jun 28 '20 at 12:57
  • 1
    You're absolutely right about the PDF here. Sorry, I brushed over that part a little quickly, this is exactly what I was doing beneath the surface. I've edited my original answer to show what's actually happening, so let me know if it still isn't clear. Essentially, we're changing the boundaries of the inner integral to reflect the fact that the value of the PDF of $x$ at values of $x$ outside of $[0,1]$ is $0$. Then, as these boundaries are min/maxes depending on $y$, we split the outer integrals around these cases. – Drathora Jun 28 '20 at 17:18