Density of sum of two independent uniform random variables on $[0,1]$

166.2k Views Asked by At

I am trying to understand an example from my textbook.

Let's say $Z = X + Y$, where $X$ and $Y$ are independent uniform random variables with range $[0,1]$. Then the PDF is $$f(z) = \begin{cases} z & \text{for $0 < z < 1$} \\ 2-z & \text{for $1 \le z < 2$} \\ 0 & \text{otherwise.} \end{cases}$$

How was this PDF obtained?

Thanks

2

There are 2 best solutions below

7
On BEST ANSWER

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 $$f_Z(z)=\int_{-\infty}^\infty f_X(x)f_Y(z-x)\,dx.$$

Now let us apply this general formula to our particular case. We will have $f_Z(z)=0$ for $z\lt 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\lt z\le 1$ and (ii) $1\lt z\lt 2$.

(i) The product $f_X(x)f_Y(z-x)$ 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(z-x)=1$, we need $z-x\ge 0$, that is, $x\le z$. So for (i), we will be integrating from $x=0$ to $x=z$. And easily $$\int_0^z 1\,dx=z.$$ Thus $f_Z(z)=z$ for $0\lt z\le 1$.

(ii) Suppose that $1\lt z\lt 2$. In order to have $f_Y(z-x)$ to be $1$, we need $z-x\le 1$, that is, we need $x\ge z-1$. So for (ii) we integrate from $z-1$ to $1$. And easily $$\int_{z-1}^1 1\,dx=2-z.$$ Thus $f_Z(z)=2-z$ for $1\lt z\lt 2$.

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 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(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. 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$.

0
On

I provide a method here by using bivariate transformation. Let $X \sim Uniform(0,1)$ and $Y \sim Uniform(0,1)$. $X$ and $Y$ are independent. We want to know the density of $X+Y$.

Since X and Y are independent, then their joint distribution is \begin{equation} \begin{split} f_{X,Y}(x,y)&=f_X(x) f_Y(y) \\ &= \begin{cases} 1 &\text{if $0<x<1, 0<y<1$}\\ 0 &\text{otherwise} \end{cases} \end{split} \end{equation}

Now let $U=X+Y, V=X$. Thus $X=V=h_1(u,v), Y=U-V=h_2(u,v)$. It is easy to compute that $|J|=1$

Thus, \begin{equation} \begin{split} f_{U,V}(u,v) &= f_{X,Y}(h_1(u,v),h_2(u,v)) |J| \\ &= \begin{cases} 1 &\text{if $(u,v) \in \mathcal{B} $}\\ 0 &\text{otherwise} \end{cases} \end{split} \end{equation}

where $\mathcal{A}=\{(x,y):f_{X,Y}(x,y) >0\} $ and $\mathcal{B}=\{(u,v):u=g_1(x,y), v=g_2(x,y) \text{ for some $(x,y) \in \mathcal{A}$}\}$

We need to know what $\mathcal{B}$ is. Since $0<x<1,o<y<1$, this is equivalent to $0<v<1, 0<u-v<1$, also equivalent to $0<v<1, v<u<v+1$. Thus $\mathcal{B} = \{ (u,v): 0<v<1, v<u<v+1$ }

enter image description here

Then $f_U(u) = \int_{-\infty}^\infty f_{U,V}(u,v) dv=\int_\mathcal{B} f_{U,V}(u,v) dv=\int_\mathcal{B} 1 dv $

Notice that $0<v<1, v<u<v+1$ implies $0<u<2$. When $0<u<1$, v varies from 0 and u. Thus $\int_\mathcal{B} 1 dv = \int_0^u 1dv=u$. When $1<u<2$, v varies from $u-1$ and 1. Thus $\int_\mathcal{B} 1 dv = \int_{u-1}^1 1dv=2-u$. Together the result holds.