Example 6. In five boxes, there are balls of the same weight and size. 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. The drawn ball turned out to be blue. What is the probability that the blue ball was drawn from a box of the first composition?
Solution. Let $A$ be the event that a blue ball is drawn from the box.

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 blue ball, given that the box chosen is $H_{1}, H_{2}, H_{3}$ respectively:

$$
\begin{aligned}
& P\left(A / H_{1}\right)=\frac{6}{10}=0.6 \\
& P\left(A / H_{2}\right)=\frac{8}{10}=0.8 \\
& P\left(A / H_{3}\right)=\frac{2}{10}=0.2
\end{aligned}
$$

According to the formula for total probability, we find

$$
P(A)=0.4 \cdot 0.6+0.4 \cdot 0.8+0.2 \cdot 0.2=0.6 .
$$

Using Bayes' formula, we find the required probability

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