(Sum of Two Independent Uniform Random Variables) If X and Y are independent random variables both uniformly distributed on (0, 1), then calculate the probability density of X + Y.
From Equation (2.18),
f_{X+Y}(a)={\frac{d}{d a}}\int_{-\infty}^{\infty}F_{X}(a-y)g(y)\,d y=\int_{-\infty}^{\infty}\frac{d}{d a}{(F_{X}{(a-y)})}g(y)\,d y
=\int_{-\infty}^{\infty}f(a-y)g(y)\,d y (2.18)
since
f(a)=g(a)=\begin{cases}1, & 0<a<1 \\0, & \text{otherwise}\end{cases}we obtain
f_{X+Y}(a)=\int_{0}^{1}f(a-y)\,d yFor 0 ≤ a ≤ 1, this yields
f_{X+Y}(a)=\int_{0}^{a}\!d y=aFor 1 < a < 2, we get
f_{X+Y}(a)=\int_{a-1}^{1}d y=2-aHence,
f_{X+Y}(a)=\begin{cases} a, & 0\leq a\leq 1 \\ 2-a, & 1<a<2 \\ 0, & \text{otherwise}\end{cases}Rather than deriving a general expression for the distribution of X + Y in the discrete case, we shall consider an example.