Example 6. Independent random variables $X$ and $Y$ have the following densities:

$$
\begin{aligned}
& p_{1}(x)= \begin{cases}0 & \text { if } x1, \\
0.5 & \text { if }-12 \\
0.5 & \text { if } 0<y \leq 2 .\end{cases}
\end{aligned}
$$

Find: 1) the distribution functions $F_{1}(x)$ and $F_{2}(y)$;

2) the density of the probability distribution of the system $(X, Y)$; 3) the distribution function of the system $(X, Y)$.
Solution. The distribution functions $F_{1}(x)$ and $F_{2}(y)$ will be found using formula (2.3.2)

$$
\text { If } x \leq-1, \text { then } \int_{-\infty}^{x} p(t) d t=\int_{-\infty}^{x} 0 d t=0 ; F_{1}(x)=0
$$

If $-1 < x \leq 1$

$$
F_{1}(x)=\int_{-\infty}^{x} p(t) d t=\int_{-\infty}^{-1} 0 d t+\int_{-1}^{x} 0.5 d t=0.5 \int_{-1}^{x} d t=0.5(x+1)
$$

If $x > 1$

$$
F_{1}(x)=\int_{-\infty}^{x} p(t) d t=\int_{-\infty}^{-1} 0 d t+\int_{-1}^{1} 0.5 d t+\int_{1}^{x} 0 d t=\int_{-1}^{1} 0.5 d t=0.5 t \bigg|_{-1}^{1}=1
$$

Therefore,

$$
F_{1}(x)= \begin{cases}0 & \text { if } x \leq-1 \\ 0.5(x+1) & \text { if } -1 < x \leq 1 \\ 1 & \text { if } x > 1\end{cases}
$$

$$
F_{2}(y)= \begin{cases}0 & \text { if } y \leq 0 \\ 0.5 y & \text { if } 0 < y \leq 2 \\ 1 & \text { if } y > 2\end{cases}
$$

Since the random variables $X$ and $Y$ are independent, equation (2.8.19) must hold, and by finding the product $F_{1}(x) \cdot F_{2}(y)$, we obtain the distribution function $F(x, y)$ of the random variable $(X, Y):$

$$
F(x, y)= \begin{cases}0 & \text { if } x \leq-1 \text { and } y \leq 0 \\ 0.25(x+1) y & \text { if } -1 < x \leq 1, 0 < y \leq 2 \\ 0.5 y & \text { if } x > 1, 0 < y \leq 2 \\ 1 & \text { if } x > 1, y > 2\end{cases}
$$

Since the random variables $X$ and $Y$ are independent, equation (2.8.20) must also hold, and by finding the product $p_{1}(x) \cdot p_{2}(y)$, we obtain the density function of the random variable $(X, Y)$:

$$
p(x, y)= \begin{cases}0 & \text { if } x \leq -1 \text { or } y \leq 0 \text { or } x > 1, y > 2 \\ 0.25 & \text { if } -1 < x \leq 1, 0 < y \leq 2\end{cases}
$$