Example 7. Given all possible values of a discrete random variable $X: x_{1}=1, x_{2}=2, x_{3}=3$, and it is known that $M(X)=2.3$, $M\left(X^{2}\right)=5.9$. Find the distribution law of the random variable $X$.
Solution. Let's write down the distribution laws of the discrete random variables $X$ and $X^{2}$:

| $X$ | 1 | 2 | 3 |
| :---: | :---: | :---: | :---: |
| $P$ | $p_{1}$ | $p_{2}$ | $p_{3}$ |


| $X^{2}$ | 1 | 4 | 9 |
| :---: | :---: | :---: | :---: |
| $P$ | $p_{1}$ | $p_{2}$ | $p_{3}$ |,

where $p_{1}, p_{2}, p_{3}$ are unknown for now, and $p_{1}+p_{2}+p_{3}=1$.

Using the condition, we obtain a system of two equations with three unknowns

$$
\left\{\begin{array}{l}
p_{1}+2 p_{2}+3 p_{3}=2.3 \\
p_{1}+4 p_{2}+9 p_{3}=5.9
\end{array}\right.
$$

Since $p_{1}+p_{2}+p_{3}=1$ and $p_{3}=1-p_{1}-p_{2}$, the system of equations becomes

$$
\left\{\begin{array}{l}
8 p_{1}+5 p_{2}=3.1 \\
2 p_{1}+p_{2}=0.7
\end{array}\right.
$$

from which $p_{1}=0.2, p_{2}=0.3$. Therefore, $p_{3}=1-p_{1}-p_{2}=0.5$.

Thus, the distribution law of the random variable $X$ is given by the table

| $X$ | 1 | 2 | 3 |
| :---: | :---: | :---: | :---: |
| $P$ | 0.2 | 0.3 | 0.5 |