405. The densities of the distributions of independent uniformly distributed random variables $X$ and $Y$ are given: $f_{1}(x)=1 / 2$ in the interval $(0,2)$, outside this interval $f_{1}(x)=0$

$f_{2}(y)=1 / 2$ in the interval $(0,2)$, outside this interval $f_{2}(y)=0$

Find the distribution function and the density of the distribution of the random variable $Z=X+Y$. Plot the density function $g(2)$.
Solution. According to the condition, the possible values of $X$ are determined by the inequality $0 < X < 4$. The function of distribution $G(z)$ is defined as follows:

- If $z \leq 0$, then $G(z)=0$.
- If $0 < z \leq 2$, then $G(z)=(1 / 8) S_{O A E D}=(1 / 8) z^{2}=z^{2} / 8$.
- If $2 < z \leq 4$, then $G(z)=(1 / 8) S_{O A B C}-(1 / 8) S_{D E F C}=(1 / 8) 4-(1 / 8)(4-z)^{2}=1-(4-z)^{2} / 8$.
- If $z > 4$, then $G(z)=(1 / 4) S_{O A B C}=1 / 4 \cdot 4=1$.

Thus, the required distribution function is:

$$
G(z)=\left\{\begin{array}{cl}
0 & \text { for } z \leq 0, \\
z^{2} / 8 & \text { for } 0 < z \leq 2, \\
1-(4-z)^{2} / 8 & \text { for } 2 < z \leq 4, \\
1 & \text { for } z > 4 .
\end{array}\right.
$$

Let's find the probability density function:

$$
g(z)=\left\{\begin{array}{cc}
0 & \text { for } z \leq 0, \\
z / 4 & \text { for } 0 < z \leq 2, \\
(4-z) / 4 & \text { for } 2 < z \leq 4, \\
0 & \text { for } z > 4 .
\end{array}\right.
$$

The graph of the probability density function $g(z)$ is shown in Fig. 10. It is recommended to verify that the area under the curve of the distribution function $g(z)$ equals one.