Example 6. Find the distribution function $F(x)$ of the random variable $X$, the probability density of which is defined by the function

$$
p(x)= \begin{cases}0 & \text { if } x \leq 0 \text{ or } x>2 \\ x & \text { if } 0<x \leq 1 \\ 2-x & \text { if } 1<x \leq 2\end{cases}
$$
Solution. To find the distribution function $F(x)$, we will use formula (2.3.2).

For $x \leq 0 \quad$ we get $F(x)=\int_{-\infty}^{0} 0 d x=0$.

For $0 < x \leq 2$ we get $F(x)=\int_{-\infty}^{x} p(t) d t=\int_{-\infty}^{0} p(t) d t+\int_{0}^{x} p(t) d t=$

![](https://cdn.mathpix.com/cropped/2024_05_22_720b3cbdc89c57e2b629g-110.jpg?height=480&width=815&top_left_y=953&top_left_x=160)

Fig. 2.9

$$
=0+\int_{0}^{x} t d t=\frac{x^{2}}{2}
$$

For $x > 2$ we get $F(x)=\int_{-\infty}^{x} p(t) d t=\int_{-\infty}^{2} p(t) d t+\int_{2}^{x} p(t) d t=$

$$
=F(2)+\int_{2}^{x} 0 d t=1
$$

Thus, the desired distribution function is

$$
F(x)= \begin{cases}0 & \text { if } x \leq 0 \\ x^{2} / 2 & \text { if } 0 < x \leq 2 \\ 1 & \text { if } x > 2\end{cases}
$$

![](https://cdn.mathpix.com/cropped/2024_05_22_720b3cbdc89c57e2b629g-111.jpg?height=473&width=814&top_left_y=273&top_left_x=137)

Fig. 2.10

The graphs of the functions $p(x)$ and $F(x)$ are shown in Fig. 2.9 and Fig. 2.10.