Example 1. In a box, there are identical items manufactured by two machines: $40 \%$ of the items are made by the first machine, the rest - by the second. Defects in the production of the first machine constitute $3 \%$, and of the second $-2 \%$. Find the probability that a randomly selected item was made by the first machine, if it turned out to be defective.
Solution. Let $A$ be the event that a randomly selected item is defective, and let $H_{1}, H_{2}$ be the events that the item was manufactured by the first and second machine, respectively.

From the condition, it follows that

$$
\begin{aligned}
& P\left(H_{1}\right)=0.4, \quad P\left(H_{2}\right)=1-P\left(H_{1}\right)=1-0.4=0.6 \\
& P\left(A / H_{1}\right)=0.03, \quad P\left(A / H_{2}\right)=0.02
\end{aligned}
$$

The desired probability will be found using formula (1.10.2), after determining $P(A)$ according to formula (1.9.1), which in this case takes the form

$$
P(A)=P\left(H_{1}\right) P\left(A / H_{1}\right)+P\left(H_{2}\right) P\left(A / H_{2}\right)
$$

Substituting the corresponding values, we get

$$
P(A)=0.4 \cdot 0.03+0.6 \cdot 0.02=0.024
$$

In accordance with formula (1.10.2), we find

$$
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.03}{0.024}=0.5
$$