Problem 4. There are two identical urns. The first urn contains 3 black and 7 white balls, while the second urn contains 4 black and 6 white balls. One urn is chosen at random, and a ball is drawn from it, which turns out to be white. What is the probability that this ball was drawn from the first urn?
Solution. Consider the events:

$A$ - the selected ball turned out to be white;

$H_{1}$ - the ball was drawn from the first urn;

$H_{2}$ - the ball was drawn from the second urn.

Since event $A$ can only occur with the realization of one of the two hypotheses, we will again use formula (**).

Let's calculate the probabilities. Since there are two urns and the ball is drawn from a randomly chosen urn, the probability of the hypotheses $p\left(H_{1}\right)=p\left(H_{2}\right)=0.5$.

Event $A / H_{1}$ means that the selected ball is white, and it was drawn from the first urn, where there are 7 white and 3 black balls, so the conditional probability $p\left(A / H_{1}\right)=0.7$. Similarly, $p\left(A / H_{2}\right)=0.6$. Substituting the found probabilities into (**), we get: $p(A)=0.5 \cdot 0.7 + 0.5 \cdot 0.6 = 0.65$.

Event $H_{1} / A$ means that the selected ball was drawn from the first urn, given that the ball turned out to be white. Using Bayes' formula (18), 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.5 \cdot 0.7}{0.65}=0.538
$$

Problem 5. An assembly shop uses parts manufactured on three machines. The shop receives $40\%$ of the parts from the first machine, $35\%$ from the second, and $25\%$ from the third. It is known that the first machine produces $1\%$ defective parts, the second $2\%$, and the third $4\%$. A part that arrived for assembly turned out to be defective. Determine the probabilities that the part came from the first, second, or third machine.

Solution. Consider the hypotheses:

$A$ - the part that arrived for assembly is defective;

$H_{1}$ - the part came from the first machine;

$H_{2}$ - the part came from the second machine;

$H_{3}$ - the part came from the third machine.

We have $p\left(H_{1}\right)=0.4 ; p\left(H_{2}\right)=0.35 ; p\left(H_{3}\right)=0.25$.
If the hypotheses $H_{1}, H_{2}, H_{3}$ are realized, then the probabilities of defects are respectively $p\left(A / H_{1}\right)=0.01, p\left(A / H_{2}\right)=0.02, p\left(A / H_{3}\right)=0.04$. Using the formula for total probability (17), we calculate $p(A)=0.4 \cdot 0.01 + 0.35 \cdot 0.02 + 0.25 \cdot 0.04 = 0.021$.

Note that the total probability of defects consists of three terms - contributions from the three hypotheses. Using Bayes' formula (18), we have:

$$
\begin{gathered}
p\left(H_{1} / A\right)=\frac{0.004}{0.021}=0.190 ; \quad p\left(H_{2} / A\right)=\frac{0.007}{0.021}=0.333 \\
p\left(H_{3} / A\right)=\frac{0.01}{0.021}=0.476
\end{gathered}
$$

## Exercises

1. The first batch of products is packed in 3 boxes, each of which contains $10\%$ of second-grade products along with first-grade products. The second batch is packed in 7 boxes, each of which contains $20\%$ of second-grade products, the rest being first-grade products.

a) Find the probability that a second-grade product will be drawn from a randomly selected box.

b) Also determine the probabilities that the product was drawn from boxes of the first or second batch, if it is a second-grade product.

2. From a box containing 3 red and 7 black pencils, one pencil was transferred to a second box containing 5 red and 4 black pencils; then one pencil was randomly taken from the second box. Find the probabilities that this pencil is red; black.
3. In the first wardrobe, there are 12 white and 8 black shirts, in the second 3 white and 5 black. Two shirts were randomly transferred from the first wardrobe to the second. The next day, one shirt was randomly taken from the second wardrobe. Find the probability that this shirt will be white.
4. Goods are delivered to a store from three factories, which have equal supply plans. The first factory fulfilled the supply plan for goods only by $60\%$, the second by $70\%$, the third by $80\%$. Determine the probabilities that the purchased item in the store is produced by the 1st, 2nd, 3rd factory.
5. On average, $50\%$ of patients admitted to the hospital have disease $\mathrm{A}$, $30\%$ have disease $\mathrm{B}$, and $20\%$ have disease $\mathrm{C}$. The probabilities of recovery from these diseases are respectively 0.7, 0.8, and 0.9. Find the probabilities that a patient admitted to the hospital will be discharged healthy. Also find the probabilities that a discharged patient suffered from disease $\mathrm{A}$, $\mathrm{B}$, $\mathrm{C}$.

## Answers

1. a) 0.17 ; b) $\frac{3}{17} ; \frac{14}{17}$. Hint. $p\left(H_{1}\right)=0.3 ; p\left(H_{2}\right)=0.7 ; p(A)=0.3 \times 0.1 + 0.7 \cdot 0.2.2 \cdot 0.53 ; 0.47.3 \cdot 0.42 \cdot$ 4. $\frac{2}{7} ; \frac{1}{3} ; \frac{8}{21} \cdot$ 5. 0.77 ; $\frac{5}{11} ; \frac{24}{77} ; \frac{18}{77}$

## § 7. Repeated Trials. Bernoulli's Formula

$1^{\circ}$. A series of $n$ independent trials is conducted. Suppose that in each trial, a certain event $A$ can occur with the same probability $p=p(A)$, or not occur with probability $q=1-p$. It is required to determine the probability $p_{n}(k)$ that event $A$ will occur exactly $k$ times $(0 \leqslant k \leqslant n)$.

Theorem 7. If $0<p<1$, then

$$
p_{n}(k)=C_{n}^{k} p^{k}(1-p)^{n-k}
$$

This formula belongs to Bernoulli. It is convenient to use for small values of $n(n \leqslant 10)$, being a special case of the multiplication theorem.

$2^{\circ}$. The probability that in $n$ independent trials, an event $A$ occurring with probability $p=p(A)$ in each trial, will occur from $k_{1}$ to $k_{2}$ times inclusive, is equal to

$$
p_{n}\left(k_{1} \leqslant k \leqslant k_{2}\right)=p_{n}\left(k_{1}\right)+p_{n}\left(k_{1}+1\right)+\ldots+p_{n}\left(k_{2}\right)
$$

There is an equality:

$$
p_{n}(0)+p_{n}(1)+p_{n}(2)+\ldots+p_{n}(n)=1
$$

$3^{\circ}$. The function $p_{n}(k)$ as a function of the variable $k, 0 \leqslant k \leqslant n$, reaches its maximum value at some $k=k_{0}$. The number $k_{0}$ is called the most probable number of occurrences of event $A$. For the number $k_{0}$, the following estimate holds:

$$
n p-q \leqslant k_{0} \leqslant n p+p
$$

## Problems with Solutions