Example 19. A coin is tossed 5 times. The random variable $X$ is the number of times the head appears. Possible values of the variable $X: \cdot x_{0}=0$, $x_{1}=1, x_{2}=2, x_{3}=3, x_{4}=4, x_{5}=5$. Write the distribution law of the random variable $X$.
Solution. The probabilities of the specified values $P\left(x=x_{k}\right)$ will be found using the Bernoulli formula, taking into account that in this case $p=1 / 2, q=1 / 2$.

$$
\begin{gathered}
P_{5}(0)=C_{n}^{0} p^{0} q^{n-0}=C_{5}^{0} \cdot\left(\frac{1}{2}\right)^{0} \cdot\left(\frac{1}{2}\right)^{5}=\frac{1}{2^{5}}=\frac{1}{32} \\
P_{5}(1)=C_{5}^{1} \cdot \frac{1}{2} \cdot \frac{1}{2^{4}}=5 \cdot \frac{1}{2^{5}}=\frac{5}{32}, P_{5}(2)=C_{5}^{2} \cdot \frac{1}{2^{2}} \cdot \frac{1}{2^{3}}=\frac{10}{32} \\
P_{5}(3)=C_{5}^{3} \cdot \frac{1}{2^{3}} \cdot \frac{1}{2^{2}}=\frac{10}{32}, P_{5}(4)=C_{5}^{4} \cdot \frac{1}{2^{4}} \cdot \frac{1}{2}=\frac{5}{32}, P_{5}(5)=C_{5}^{5} \cdot \frac{1}{2^{5}} \cdot \frac{1}{2^{0}}=\frac{1}{32}
\end{gathered}
$$

Therefore, the distribution law of the random variable $X$ can be written in the form of a table

| $X$ | 0 | 1 | 2 | 3 | 4 | 5 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $P$ | $1 / 32$ | $5 / 32$ | $10 / 32$ | $10 / 32$ | $5 / 32$ | $1 / 32$ |