Example 13. There are two urns with balls of three colors. The first contains 2 blue, 3 red, and 5 green balls, while the second contains 4 blue, 2 red, and 4 green balls. One ball is drawn from each urn and their colors are compared. Find the probability that the colors of the drawn balls are the same (event $A$).
Solution. Let the event of drawing a blue ball from the first urn be denoted by $B_{1}$, a red ball by $C_{1}$, and a green ball by $D_{1}$. Similar events for the second urn will be denoted by $B_{2}, C_{2}, D_{2}$ respectively. Event $A$ occurs in the case of $B_{1} B_{2}, C_{1} C_{2}$, or $D_{1} D_{2}$, i.e., $A=B_{1} B_{2}+C_{1} C_{2}+D_{1} D_{2}$. Since the events $B_{1} B_{2}, C_{1} C_{2}, D_{1} D_{2}$ are mutually exclusive, formula (1.8.3) can be applied with $n=3$:

$$
P(A)=P\left(B_{1} B_{2}+C_{1} C_{2}+D_{1} D_{2}\right)=P\left(B_{1} B_{2}\right)+P\left(C_{1} C_{2}\right)+P\left(D_{1} D_{2}\right)
$$

Since the events $B_{1}$ and $B_{2}, C_{1}$ and $C_{2}, D_{1}$ and $D_{2}$ are independent, formula (1.8.10) can be used for each pair of events.

$$
\begin{aligned}
& P\left(B_{1} B_{2}\right)=P\left(B_{1}\right) P\left(B_{2}\right) \\
& P\left(C_{1} C_{2}\right)=P\left(C_{1}\right) P\left(C_{2}\right) \\
& P\left(D_{1} D_{2}\right)=P\left(D_{1}\right) P\left(D_{2}\right)
\end{aligned}
$$

Therefore,

$$
\begin{aligned}
& P(A)=P\left(B_{1}\right) P\left(B_{2}\right)+P\left(C_{1}\right) P\left(C_{2}\right)+P\left(D_{1}\right) P\left(D_{2}\right)= \\
& =0.2 \cdot 0.4+0.3 \cdot 0.2+0.5 \cdot 0.4=0.34
\end{aligned}
$$