Sum of two uniform random variables, what’s the bounds for integration

probability distributions

Consider random variable $X_i$s are independent and identically distributed. We assume that each $X_i$ is uniformly distributed in $[0, 1].$

(a) Find the cdf and pdf for $Z = X1 + X2$.

(b) Draw the pdf of $Z$.

So for (a), I understand that we should be first be finding the cdf of $Z$ by:

$F_Z(z)=P(X_1+X_1\le Z)=\int_{X_2=…}^{X_2=…}\int_{X_1=…}^{X_1=…} f(x_1,x_2)dx_1 dx_2$

and that $f(x_1,x_2)=1\times 1$

However, I'm really confused in how to set up the bounds:

$0 \le x_1 \le 1, 0 \le x_2 \le 1, x_1+x_2 \le z$

I tried doing from $\int_{X_2=0}^{X_2=1}\int_{X_1=0}^{X_1=z-x_2}$, but I now for sure that something is wrong since I got my pdf to have an area of 2. Could someone help?

Best Answer

We compute the density of $Z$ by convolution. Let $f_{X_1}(t)=\mathsf 1_{(0,1)}(t)$ and $f_{X_2}(t)=\mathsf 1_{(0,1)}(t)$ be the densities of $X_1$ and $X_2$, respectively. Then the density of $Z=X_1+X_2$ is given by \begin{align} f_Z(t) &= (f_{X_1}\star f_{X_2})(t)\\ &= \int_{\mathbb R}f_{X_1}(\tau)f_{X_2}(t-\tau)\ \mathsf d\tau.\\ &= \int_{\mathbb R}\mathsf 1_{(0,1)}(\tau)\mathsf 1_{(0,1)}(t-\tau)\ \mathsf d\tau. \end{align} For the integrand to be positive, we must have $0<\tau<1$ and $0<t-\tau<1$. First note that because $X_1$ and $X_2$ take values in $(0,1)$, $Z$ takes values in $(0,2)$. So for $0<t<1$ we have $0<\tau<t$, so that $$ f_Z(t) = \int_0^t \ \mathsf d\tau = t. $$ For $1<t<2$ we have $t-1<\tau<1$, so that $$ f_Z(t) = \int_{t-1}^1 \ \mathsf d\tau = 2 - t. $$ It follows that $$ f_Z(t) = t\cdot\mathsf 1_{(0,1)}(t) + (2-t)\cdot\mathsf 1_{(1,2)}(t). $$ We compute the distribution function of $Z$ by integrating the density. For $0\leqslant t<1$ we have $$ F_Z(t) = \int_0^t s\ \mathsf ds = \frac12 t^2. $$ For $1\leqslant t<2$ we have \begin{align} F_Z(t) &= \int_0^1 s\ \mathsf ds + \int_1^t (2-s)\ \mathsf ds\\ &= \frac12 + \frac12(t-1)(3-t)\\ &= \frac12 (1 +(t-1)(3-t)). \end{align} It follows that $$ F_Z(t) = \begin{cases} 0,&t<0\\ \frac12t^2,&0\leqslant t<1\\ \frac12 (1 +(t-1)(3-t)),&1\leqslant t<2\\ 1,&t\geqslant 2. \end{cases} $$

Related Question