Example 1. At a factory manufacturing bolts, the first machine produces $30 \%$, the second - $25 \%$, the third - $45 \%$ of all products. The defect rate in their products is $2 \%$, $1 \%$, $3 \%$ respectively. Find the probability that a randomly selected bolt is defective.
Solution. Let $A$ be the event that a randomly selected bolt is defective, and let $H_{1}, H_{2}, H_{3}$ be the events that this bolt is produced by the first, second, and third machines, respectively. From the problem statement, we have

$$
\begin{aligned}
& P\left(H_{1}\right)=0.30, P\left(H_{2}\right)=0.25, P\left(H_{3}\right)=0.45 \\
& P\left(A / H_{1}\right)=0.02, P\left(A / H_{2}\right)=0.01, P\left(P / H_{3}\right)=0.03 .
\end{aligned}
$$

Using formula (1.9.1) for $n=3$, we get

$$
\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.3 \cdot 0.02+0.25 \cdot 0.01+0.45 \cdot 0.03=0.022 .
\end{aligned}
$$