106. A battery of three guns fired a salvo, with two shells hitting the target. Find the probability that the first gun hit the target, given that the probabilities of hitting the target with the first, second, and third guns are respectively $p_{1}=0.4, p_{2}=0.3, p_{3}=0.5$.
Solution. Let $A$ be the event that two guns hit the target. We make two assumptions (hypotheses): $B_{1}$ - the first gun hit the target; $B_{2}$ - the first gun missed the target.

According to the condition, $P\left(B_{1}\right)=0.4$; therefore (event $B_{2}$ is the opposite of event $B_{1}$),

$$
P\left(B_{2}\right)=1-0.4=0.6.
$$

Let's find the conditional probability $P_{B_{1}}(A)$, i.e., the probability that two shells hit the target, one of which was fired by the first gun and, consequently, the second - either by the second gun (in which case the third gun missed), or by the third (in which case the second gun missed). These two events are mutually exclusive, so the addition theorem applies:

$$
P_{B_{1}}(A)=p_{2} \cdot q_{3}+p_{3} \cdot q_{2}=0.3 \cdot 0.5+0.5 \cdot 0.7=0.5
$$

Let's find the conditional probability $P_{B_{2}}(A)$, i.e., the probability that two shells hit the target, while the first gun missed. In other words, we need to find the probability that the second and third guns hit the target. These two events are independent, so the multiplication theorem applies:

$$
P_{B_{2}}(A)=p_{2} \cdot p_{3}=0.3 \cdot 0.5=0.15
$$

The required probability that the first gun hit the target, according to Bayes' formula, is

$$
\begin{gathered}
P_{A}\left(B_{1}\right)=\frac{P\left(B_{1}\right) \cdot P_{B_{1}}(A)}{P\left(B_{1}\right) \cdot P_{B_{1}}(A)+P\left(B_{2}\right) \cdot P_{B_{2}}(A)}= \\
=0.4 \cdot 0.5 /(0.4 \cdot 0.5+0.6 \cdot 0.15)=20 / 29.
\end{gathered}
$$