Suppose $X$ and $Y$ are independent random variables, each with the density function $f$ given by
$$
f(x)= \begin{cases}1 & \text { for } 0<x<1 \\ 0 & \text { otherwise. }\end{cases}
$$
Show that the density function of $Z=X+Y$ is given by
$$
f_Z(z)= \begin{cases}z & \text { for } 0 \leq z \leq 1 \\ 2-z & \text { for } 1<z \leq 2 \\ 0 & \text { otherwise. }\end{cases}
$$
Thus, $Z$ has a triangular distribution. (As we shall see in Chapter 3, $X$ and $Y$ are said to be uniformly distributed.) Hint: This Exercise can be solved by using convolution (Theorem 2.7.5) or by using the Laplace-Stieltjes transform (Theorem 2.9.3(a) and (d)).