Example 7. Two dice are rolled. The discrete random variable $X$ is the sum of the points that appear on both dice. Find the mathematical expectation of this random variable.
Solution. This random variable takes all integer values from 2 to 12. The distribution law can be given by the following table:

| $X$ | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $P$ | $\frac{1}{36}$ | $\frac{2}{36}$ | $\frac{3}{36}$ | $\frac{4}{36}$ | $\frac{5}{36}$ | $\frac{6}{36}$ | $\frac{5}{36}$ | $\frac{4}{36}$ | $\frac{3}{36}$ | $\frac{2}{36}$ | $\frac{1}{36}$ |

By formula (2.4.3) we find

$$
\begin{aligned}
& M(X)=2 \cdot \frac{1}{36}+3 \cdot \frac{2}{36}+4 \cdot \frac{3}{36}+5 \cdot \frac{4}{36}+6 \cdot \frac{5}{36}+ \\
& +7 \cdot \frac{6}{36}+8 \cdot \frac{5}{36}+9 \cdot \frac{4}{36}+10 \cdot \frac{3}{36}+11 \cdot \frac{2}{36}+12 \cdot \frac{1}{36}= \\
& =\frac{2+6+12+20+30+42+40+36+30+22+12}{36}=\frac{252}{36}=7
\end{aligned}
$$

Remark 1. This result can be obtained more easily. Let the random variable for the number of points that fall on one die be denoted by $X$, and on the other die by $Y$. These random variables have the same distribution laws (see Example 6). By formula (2.4.12) we get

$$
M(X+Y)=M(X)+M(Y)=3.5+3.5=7
$$

Remark 2. Since the variables $X$ and $Y$ are independent, we can also find the mathematical expectation of the random variable $Z=XY$ - the product of the number of points that fall when two dice are rolled simultaneously. By formula (2.4.15) we have:

$$
M(Z)=M(X \cdot Y)=M(X) \cdot M(Y)=3.5 \cdot 3.5=12.25
$$