Example 2. In five boxes, there are balls of the same size and weight. In two boxes - 6 blue and 4 red balls each (this is box composition $H_{1}$). In two other boxes (composition $H_{2}$) - 8 blue and 2 red balls each. In one box (composition $H_{3}$) - 2 blue and 8 red balls. A box is randomly chosen and a ball is drawn from it. What is the probability that the drawn ball is red?
Solution. Let the event "a red ball is drawn" be denoted by $A$.

From the problem statement, it follows that

$$
P\left(H_{1}\right)=\frac{2}{5}=0.4, \quad P\left(H_{2}\right)=\frac{2}{5}=0.4, \quad P\left(H_{3}\right)=\frac{1}{5}=0.2 .
$$

The probability of drawing a red ball, given that the box is from the first batch $H_{1}$,

$$
P\left(A / H_{1}\right)=\frac{4}{10}=0.4
$$

The probability of drawing a red ball, given that the box is from the second batch,

$$
P\left(A / H_{2}\right)=\frac{2}{10}=0.2
$$

The probability of drawing a red ball, given that the box is from the third batch $H^{3}$,

$$
P\left(A / H_{3}\right)=\frac{8}{10}=0.8
$$

According to formula (1.9.1) for $n=3$, we find the required probability

$$
\begin{aligned}
& P(A)=P\left(H_{1}\right) P\left(A / H_{1}\right)+P\left(H_{2}\right) P\left(A / H_{2}\right)+P\left(H_{3}\right) P\left(A / H_{3}\right)= \\
& =0.4 \cdot 0.4+0.4 \cdot 0.2+0.2 \cdot 0.8=0.4
\end{aligned}
$$