# Sum of three uniformly distributed random variables.

Let $X,Y,Z$ be uniformly distributed $U(0,1)$. Then I know that the density function for the random variable $A= X+Y$ is $$f(a) = \begin{cases} a & a\in (0,1)\\ 2-a & a\in[1,2)\\ 0 & \text{ otherwise} \end{cases}.$$ and $$g(z)=\begin{cases} 1 & z\in (0,1)\\ 0 & \text{otherwise} \end{cases}$$ My goal is to find the $B = A+Z.$ By the convolution theorem: $$h(b) = \int_{-\infty}^{\infty}f(b-z)g(z)dz=\int_{0}^{1}f(b-z)dz.$$

After this I am not sure how to proceed. Any help will be much appreciated.

• Crucial assumption missing in the question is that $X,Y,Z$ are independently distributed. – StubbornAtom Sep 9 '18 at 8:06

So we get $$f(b-z) = \begin{cases} b-z & b-z\in (0,1)\\ 2-(b-z) & b-z\in[1,2)\\ 0 & \text{ otherwise} \end{cases}.$$ We have that $$0<z<1$$ or $$b-1<b-z<b$$ If $b < 0$, then $b - z < 0$, so $h(b) = 0$ according to the boundaries we have. On the other hand if $b - 1> 2$ (or $b>3$), that is is $b-z>2$, we also get $f(b) = 0$. Other than that, we can distinguish three cases:
Case 1: If $0<b<1$ $$h(b) = \int_{0}^{1}f(b-z)dz = \int_0^{b} b-z \ dz = \frac{b^2}{2}$$
Case 2: If $1<b<2$ $$h(b) = \int_{0}^{1}f(b-z)dz = \int_{b-1}^{1} b-z \ dz + \int_{0}^{b-1} 2-(b-z) \ dz = \frac{b(2-b)}{2}-\dfrac{b^2-4b+3}{2}$$
Case 3: If $2<b<3$, we have $$h(b) = \int_{0}^{1}f(b-z)dz = \int_{b-2}^{1} 2-(b-z) \ dz = \frac{b^2-6b+9}{2}$$
Distribution of B $$h(b) = \begin{cases} \frac{b^2}{2} & b\in (0,1)\\ \frac{b(2-b)}{2}-\frac{b^2-4b+3}{2} & b\in(1,2)\\ \frac{b^2-6b+9}{2} & b\in(2,3)\\ 0 & \text{ otherwise} \end{cases}.$$
• Hello @Hello_World, well you know, allowing $z$ to go from $0$ till $b$ is allowing $x$ in $f(x)$ to vary from $x = b-z = b-b = 0$ till $x = b-z = b-0 = b$. You need to cover all the case where $b - z \in [0,1]$, right ? – Ahmad Bazzi Sep 9 '18 at 21:16