William Curry

2021-12-14

Let's say Z=X+Y, where X and Y are independent uniform random variables with range [0,1]. Then the PDF is

sonSnubsreose6v

If we want to use a convolution, let ${f}_{X}$ be the full density function of X, and let ${f}_{Y}$ be the full density function of Y. Let Z=X+Y. Then
$fz\left(z\right)={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}{f}_{X}\left(x\right){f}_{Y}\left(z-x\right)dx$.
Now let us apply this general formula to our particular case. We will have ${f}_{Z}\left(z\right)=0f\phantom{\rule{1em}{0ex}}\text{or}\phantom{\rule{1em}{0ex}}z<0,$ and also for $z\ge 2$. Now we deal with the interval from 0 to 2. It is useful to break this down into two cases (i) $0.
(i) The product ${f}_{X}\left(x\right){f}_{Y}\left(z-x\right)$is 1 in some places, and 0 elsewhere. We want to make sure we avoid calling it 1 when it is 0. In order to have ${f}_{Y}\left(z-x\right)=1,we\ne edz-x\ge 0,t\stackrel{^}{i}s,x\le z$. So for (i), we will be integrating from x = 0 to x = z. And easily
${\int }_{0}^{z}1dx=z$
Thus ${f}_{Z}\left(z\right)=zf\phantom{\rule{1em}{0ex}}\text{or}\phantom{\rule{1em}{0ex}}0
(ii) Suppose that 1<z<2. In order to have fY(z−x) to be 1, we need $z-x\le 1,t\stackrel{^}{i}s,we\ne edx\ge z-1$. So for (ii) we integrate from z−1 to 1. And easily
${\int }_{1}^{z-1}1dx=2-z$
Thus ${f}_{Z}\left(z\right)=2-zf\phantom{\rule{1em}{0ex}}\text{or}\phantom{\rule{1em}{0ex}}1.
Another way: (Sketch) We can go after the cdf ${F}_{Z}\left(z\right)ofZ$, and then differentiate. So we need to find $Pr\left(Z\le z\right)$.
For a few fixed z values, draw the lines with equation x+y=z on an x-y axis plot. Draw the square S with corners (0,0), (1,0), (1,1), and (0,1).
Then $Pr\left(Z\le z\right)$ is the area of the part S that is "below" the line x+y=z. That area can be calculated using basic geometry. For example, when z is 2, the whole square area is under the line so Pr=1. There is a switch in basic shape at z=1.

ol3i4c5s4hr

By the hint of jay-sun, consider this idea, if and only if $fX\left(z-y\right)=1when0\le z-y\le 1$. So we get
$z-1\le y\le z$
however, $z\in \left[0,2\right]$, the range of y may not be in the range of [0,1] in order to get ${f}_{X}\left(z-y\right)=1$, and the value 1 is a good splitting point. Because $z-1\in \left[-1,1\right]$.
Consider $\left(i\right)\phantom{\rule{1em}{0ex}}\text{if}\phantom{\rule{1em}{0ex}}z-1\le 0then-1\le z-1\le 0t\stackrel{^}{i}sz\in \left[0,1\right]$, we get the range of $y\in \left[0,z\right]\mathrm{sin}cez\in \left[0,1\right]$. And we get ${\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}{f}_{X}\left(z-y\right)dy={\int }_{0}^{z}1dy=z\phantom{\rule{1em}{0ex}}\text{if}\phantom{\rule{1em}{0ex}}z\in \left[0,1\right]$.
Consider $\left(ii\right)\phantom{\rule{1em}{0ex}}\text{if}\phantom{\rule{1em}{0ex}}z-1\ge 0t\stackrel{^}{i}sz\in \left[1,2\right]$, so we get the range of y $\in \left[z-1,1\right],\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}{\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}{f}_{X}\left(z-y\right)dy={\int }_{z-1}^{1}1dy=2-z\phantom{\rule{1em}{0ex}}\text{if}\phantom{\rule{1em}{0ex}}z\in \left[1,2\right]$
To sum up, consider to clip the range in order to get ${f}_{X}\left(z-y\right)=1$.

Do you have a similar question?