1

Let $X, Y$ be independent random variables, both uniformly distributed over the interval $(0,1)$. That is, $$f_{X}(a)=f_{Y}(a) = \begin{cases} 1 & \text{if $0 < a < 1$} \\ 0 & \text{otherwise} \end{cases}$$ Find $f_{X+Y}(a)$.

In my probability course, the solution to this problem was given as follows, but figuring out the integrals was very much "by inspection", and for this one, particular problem.

$$ f_{X+Y}(a) = \begin{cases} \int_{0}^{a} dy = a & \text{if $0 < a < 1$} \\\int_{a-1}^{1} dy = 2 - a & \text{if $1 < a < 2$} \end{cases}$$

It's not so apparent to me how we know these are the correct integration bounds in these two cases. I want a general, straightforward way to figure out exactly which integrals need to be computed for probability problems of this kind. So I read this answer by André Nicolas, which it finally made it clear to me how to start finding $P(X+Y \le a)$:

Another way: (Sketch) We can go after the cdf $F_Z(z)$ of $Z$, and then differentiate. So we need to find $\Pr(Z\le z)$.

For fixed $z$, draw the line with equation $x+y=z$. Draw the square $S$ with corners $(0,0)$, $(1,0)$, $(1,1)$, and $(0,1)$.

Then $\Pr(Z\le z)$ is the area of the part $S$ that is "below" the line $x+y=z$. That area can be calculated using basic geometry. There is a switch in basic shape at $z=1$.

Then by drawing a figure with a square with vertices $(0,0), (0, 1), (1,0), (1,1)$, I come up with the following two integrals:

$$ \small P(X+Y \le a) = \int_{0}^{1} \left( \int_{0}^{a-y} f(x) \ \mathrm{d} x \right) f(y) \ \mathrm{d}y = \int_{0}^{1} \left( a-y \right )1 \ \mathrm{d}y = a - \frac{1}{2} \ \ \ \ \ \text{if $0 < a < 1$} $$

$$ \small P(X+Y \le a) = \int_{0}^{1} \left( \int_{1-y}^{a-y} f(x) \ \mathrm{d} x \right) f(y) \ \mathrm{d}y = \int_{0}^{1} \left( (a-y) - (1 - y) \right )1 \ \mathrm{d}y = \int_{0}^{1} (a - 1) \ \mathrm{d}y \ \ \ \text{if $1 < a < 2$} $$

It appears that I have made a mistake somewhere, since $\frac{d}{\mathrm{d}\ a}\left(F_{X+Y}(a) \right) =\frac{d}{\mathrm{d}\ a}\left( P(X+Y\le a) \right) = f_{X+Y}(a)$ in neither case gives me the correct answer for $f_{X+Y}(a)$.

Please help me see my mistake; what am I missing?

NaN
  • 1,467

2 Answers2

3

This problem is best solved by drawing diagram by plotting the line $x+y=z$ in 'x-y' plane and measuring the area under the line over the rectangle enclosed by $(0,0), (0,1), (1,0)$ and $(1,1)$ [covering $(x+y\leqslant z)$]. This is my recommendation. Alternatively, you may want to use method of convolution while calculating cdf of the sum X+Y exactly the way you have attempted (for details see this).

Looking at your approach I can see the issue in the range of y used in the integral when you try to find $P(X+Y\le a)$ for $0<a<1$. Unfortunately you can't write: $\int_{0}^{1} \left( \int_{0}^{a-y} f(x) \ \mathrm{d} x \right) f(y) \ \mathrm{d}y = \int_{0}^{1} \left( a-y \right )1 \ \mathrm{d}y$, since, when $0<X<a-y$, $0<a-Y<1$; thus, $a-1<Y<a$; but since we are evaluating the cdf for $0\le a\le1$, the range of Y eventually reduces to $0<Y<a$.

Similar sort of issue appears for the case $1\le a\le2$. Basically we just need to be a bit careful about the ranges so that the bounds used are valid ones.

Sauvik De
  • 716
0

We want to obtain the probability density of the addition of two random variables: $Z=X+Y$. And we know that $X$ and $Y$ are uniformly distributed along the interval $[0,1]$.

Furthermore, we have probability densities:

$$P_X(x)=P_Y(y)=\begin{cases} 1, \quad \text{when }0\leq x,y \leq1 \\ 0,\quad \text{otherwise} \end{cases}$$

With this information, we can define the domains (or probability spaces) of the three variables: $\Omega_X=[0,1]$, $\Omega_Y=[0,1]$, and because the lowest possible value of $X$ and $Y$ is $0$, and the maximum is $1$, $\Omega_Z =[0+0,1+1]=[0,2]$. This might seem way too obvious, but it is important for the rest of the solution, especially for the most common confusion related to this problem, which is setting the bounds of integration.

We also know that the sum of two random variables is equal to the convolution of their probability density functions, therefore: $$P_Z(z)=\int_{-\infty}^{\infty}{f_Y(z-x)f_X(x)}\,dx$$ However, by the definition of our functions, everything outside the range $[0,1]$ is $0$, and you would want to integrate over $\Omega_X$ anyway, so our integral becomes: $$P_Z(z)=\int_{\Omega_X}{f_Y(z-x)f_X(x)}\,dx=\int_{0}^{1}{f_Y(z-x)f_X(x)}\,dx$$ Because the integral is a product of functions, we also want to avoid any values where either $f_Y$ or $f_X$ are $0$. We don't worry about $f_X(x)$, because it will always be $1$ within our bounds of integration, hence: $$P_Z(z)=\int_{0}^{1}{f_Y(z-x)\cdot 1}\,dx =\int_{0}^{1}{f_Y(z-x)}\,dx$$ Now we must avoid any values where $f_Y(z-x)=0$; that is, we only want values of $f_Y$ such that $0 \leq z-x \leq 1$. For the first condition, $0 \leq z-x$ if and only if $x \leq z$. That is to say, within the bounds of integration, we only want values of $x \in [0,z]$ and we "discard" those in $[z,1]$, so our integral becomes:

\begin{align} P_Z(z)=\int_{0}^{1}{f_Y(z-x)}\,dx = \int_{0}^{z}{f_Y(z-x)}\,dx+\int_{z}^{1}{f_Y(z-x)}\,dx \\ =\int_{0}^{z}{f_Y(z-x)}\,dx+0 =\int_{0}^{z}{1}\,dx= z \end{align} But if $z > 1$, we would be outside $\Omega_X$, our bounds of integration! Consequently, this piece only works for $z\in [0,1]$.

When we turn to the second condition, we discover that $z-x \leq 1$ only when $x \geq z-1$. So, if we divide $\Omega_X$ again, we have the intervals $[0,z-1]$ and $[z-1,1]$. So we define the integrals: \begin{align} P_Z(z)= \int_{0}^{z-1}{f_Y(z-x)}\,dx+\int_{z-1}^{1}{f_Y(z-x)}\,dx \\ =0+\int_{z-1}^{1}{f_Y(z-x)}\,dx =\int_{z-1}^{1}{1}\,dx= 2-z \end{align} But because $x \geq z-1$, then $z \geq 1$, or we would be outside the bounds of integration. But if $z > 2$, then $x>1$, which is impossible, therefore this piece only works for $z \in [1,2]$. And now we have covered the full domain of $P_Z$, because $[0,1]\cup [1,2] = \Omega_Z$.

We know from our direct examination of $f_Y(z-x)$ that all values in $[z,1]$ and $[0,z-1]$ are $0$, but, if you follow through with the integration and evaluation of these parts, you will discover they actually cancel out. This understanding, I think, is crucial as you move to the next challenge, which is finding the probability density function for $X+Y+Z$.