Example 13. Find the mathematical expectation of a random variable $X$, the distribution function of which is given by

$$
F(x)= \begin{cases}0 & \text { if } x \leq -a \\ \frac{(a+x)^{2}}{2 a^{2}} & \text { if } -a < x \leq a \\ 1 & \text { if } x > a\end{cases}
$$
Solution. First, let's find the probability density function of this random variable. Since \( p(x) = F'(x) \), we have:

\[
p(x)= \begin{cases}0 & \text{if } x \leq -a \\ \frac{1}{a}\left(1+\frac{x}{a}\right) & \text{if } -a < x \leq 0 \\ \frac{1}{a}\left(1-\frac{x}{a}\right) & \text{if } 0 < x \leq a \\ 0 & \text{if } x > a\end{cases}
\]

Using formula (2.4.7), we find the required expected value:

\[
\begin{aligned}
& M(X)=\int_{-a}^{a} x p(x) d x=\int_{-a}^{0} \frac{1}{a}\left(1+\frac{x}{a}\right) x d x+\int_{0}^{a} \frac{1}{a}\left(1-\frac{x}{a}\right) x d x= \\
& =\frac{1}{a} \int_{-a}^{0}\left(x+\frac{x^{2}}{a}\right) d x+\frac{1}{a} \int_{0}^{a}\left(x-\frac{x^{2}}{a}\right) d x=\left.\frac{1}{a}\left(\frac{x^{2}}{2}+\frac{x^{3}}{3 a}\right)\right|_{-a} ^{0}+ \\
& +\left.\frac{1}{a}\left(\frac{x^{2}}{2}-\frac{x^{3}}{3 a}\right)\right|_{0} ^{a}=\frac{1}{a}\left(-\frac{(-a)^{2}}{2}-\frac{(-a)^{3}}{3 a}\right)+\frac{1}{a}\left(\frac{(a)^{2}}{2}-\frac{(a)^{3}}{3 a}\right)=0
\end{aligned}
\]

## Problems

1. Find the expected value of a discrete random variable whose distribution is given by the table:

| $X$ | 1 | 2 | 3 | 4 | 5 |
| :---: | :---: | :---: | :---: | :---: | :---: |
| $P$ | 0.15 | 0.25 | 0.3 | 0.2 | 0.1 |

2. The distribution of a discrete random variable is given by the table:

| $X$ | 3 | 6 | 9 | 12 |
| :---: | :---: | :---: | :---: | :---: |
| $P$ | 0.1 | 0.2 | 0.3 | 0.4 |

Write the distribution laws for the random variables $2X$, $X/3$. Find the expected values of the random variables $X$, $2X$, $X/3$.

3. The expected values of two random variables $X$ and $Y$ are known: $M(X)=7$, $M(Y)=4$. Find the expected values of the sum and difference of these variables.
4. The expected values of two independent random variables $X$ and $Y$ are known: $M(X)=6$, $M(Y)=8$. Find the expected value of their product.
5. Find the expected value of the random variable $Y=8X+5$, if it is known that $M(X)=1.5$.
6. A discrete random variable $X$, which can take an infinite sequence of values, is given by the following distribution:

| $X$ | $1/4$ | $1/4^2$ | $1/4^3$ | $\ldots$ | $1/4^k$ | $\ldots$ |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| $P$ | $1/2$ | $1/2^2$ | $1/2^3$ | $\ldots$ | $1/2^k$ | $\ldots$ |

\[
\sum_{k=1}^{\infty} \frac{1}{2^k}=1
\]

Find the expected value of this random variable.

7. The probability density function of a random variable $X$ is given by

\[
p(x)= \begin{cases}0 & \text{if } x \leq 0 \\ 3x^2 & \text{if } 0 < x \leq 1 \\ 0 & \text{if } x > 1\end{cases}
\]

Find the expected value of the random variable $X$.

8. Find the expected value of the random variable $X$, if the distribution function of this variable is given by

\[
F(x)= \begin{cases}0 & \text{if } x \leq 0 \\ x/3 & \text{if } 0 < x \leq 3 \\ 1 & \text{if } x > 3\end{cases}
\]

9. Find the expected value of the random variable $X$, if the distribution function is given by

\[
F(x)=\begin{cases}
0 & \text{if } x \leq 0 \\
1-e^{-\alpha x} & \text{if } x > 0
\end{cases} \quad (\alpha > 0)
\]

## Answers

1. 2.85. 2. 9, 18, 3. 11, 3. 4. 48. 5. 17. 6. 1/7. 7. 0.75. 8. 4.5. 9. 1/α.

## Questions

1. How is the expected value of a discrete random variable $X$ defined, which takes a finite set of values?
2. What other names are used for the expected value? What explains these names?
3. What is the expected value of a discrete random variable $X$ that takes a countable set of values?
4. How is the expected value of a continuous random variable defined, all values of which belong to the interval $[\alpha, \beta]$?
5. How is the expected value of a continuous random variable defined, all values of which belong to the infinite interval $(-\infty, +\infty)$?
6. What are the properties of the expected value of a random variable?
7. What conditions must random variables $X$ and $Y$ satisfy for equation (2.4.15) to hold?
8. Prove that the expected value of a non-negative discrete variable is non-negative.

## § 2.5. Variance of a Random Variable. Mean Square Deviation

The difference $X - M(X)$ is called the deviation of the random variable $X$ from its expected value $M(X)$. The expected value of the deviation is zero:

\[
M(X - M(X)) = 0
\]

The variance, or dispersion, of a random variable $X$ is the expected value of the square of its deviation:

\[
D(X) = M\left((X - M(X))^2\right)
\]

From the definition and properties of the expected value, it follows that the variance of any random variable is non-negative, i.e.,

\[
D(X) \geq 0
\]

For calculating the variance, the formula

\[
D(X) = M(X^2) - (M(X))^2
\]

is used.

The variance of a random variable has the following properties:

1. The variance of a constant is zero:

\[
D(C) = 0 \quad (C = \text{const})
\]

2. A constant factor can be factored out of the variance, squaring it:

\[
D(CX) = C^2 D(X) \quad (C = \text{const})
\]

4. The variance of the sum of two independent random variables is equal to the sum of their variances:

\[
D(X + Y) = D(X) + D(Y)
\]

5. The variance of the difference of two independent random variables is equal to the sum of their variances:

\[
D(X - Y) = D(X) + D(Y)
\]

Remark. Property 3 extends to $n$ independent random variables:

\[
D(X_1 + X_2 + \ldots + X_n) = D(X_1) + D(X_2) + \ldots + D(X_n)
\]

The variance of a discrete random variable with the distribution

\[
\begin{aligned}
& P(X = x_k) = p_k \quad (k = 1, 2, \ldots, n) \\
& \sum_{k=1}^{n} p_k = 1
\end{aligned}
\]

is defined by the formula

\[
D(X) = \sum_{k=1}^{n} (x_k - M(X))^2 p_k
\]

or the formula

\[
D(X) = \sum_{k=1}^{n} (x_k - a)^2 p_k
\]

where

\[
a = M(X)
\]

is another notation for the expected value. We will use this notation in the future, depending on the circumstances.

If a discrete random variable takes an infinite sequence of values with the distribution

\[
\begin{aligned}
& P(X = x_k) = p_k \quad (k = 1, 2, 3, \ldots) \\
& \sum