79. A shooter makes three attempts. The success (hitting the target) and failure (miss) of each of them are independent of the outcomes of the other attempts, and the probability of successful completion of each attempt is constant and equal to p. Find the probability of successful completion of two attempts out of three.
Solution. Let $A_{1}, A_{2}$ and $A_{3}$ be the success in the first, second, and third attempts, respectively. Then, two successful attempts correspond to the following events: $A_{1} A_{2} \bar{A}_{3}$ - the first two attempts are successful, the third is not; $A_{1} \bar{A}_{2} A_{3}$ - the first and third attempts are successful, the second is not; $\bar{A}_{1} A_{2} A_{3} \ldots$ the last two attempts are successful, the first is not.

The event of interest can be written as the sum $A_{1} A_{2} \bar{A}_{3} + A_{1} \bar{A}_{2} A_{3} + \bar{A}_{1} A_{2} A_{3}$. Since the events in this sum are mutually exclusive, and the events $A_{1}, A_{2}, A_{3}$ are independent, we find by the formulas of addition and multiplication:

$$
\begin{gathered}
P\left(A_{1} A_{2} \bar{A}_{3} + A_{1} \bar{A}_{2} A_{3} + \bar{A}_{1} A_{2} A_{3}\right) = P\left(A_{1} A_{2} \bar{A}_{3}\right) + P\left(A_{1} \bar{A}_{2} A_{3}\right) + P\left(\bar{A}_{1} A_{2} A_{3}\right) = \\
= P\left(A_{1}\right) P\left(A_{2}\right) P\left(\bar{A}_{3}\right) + P\left(A_{1}\right) P\left(\bar{A}_{2}\right) P\left(A_{3}\right) + P\left(\bar{A}_{1}\right) P\left(A_{2}\right) P\left(A_{3}\right)
\end{gathered}
$$

The probability of hitting the target in each attempt is $p$, so the probability of a miss is $q=1-p$. Substituting these values, we get

$$
\begin{aligned}
P\left(A_{1} A_{2} \bar{A}_{3} + A_{1} \bar{A}_{2} A_{3} + \bar{A}_{1} A_{2} A_{3}\right) & = p \cdot p(1-p) + p(1-p) p + (p-1) p \cdot p = \\
& = 3 p^{2}(1-p)
\end{aligned}
$$

In this example, we have familiarized ourselves with a general scheme that was first considered by the Swiss mathematician J. Bernoulli, and is called the Bernoulli scheme.

In the general case, this scheme leads to the formula

$$
P\left(A_{n, k}\right) = C_{n}^{k} p^{k}(1-p)^{n-k} = C_{n}^{k} p^{k} q^{n-k}
$$

which is called the Bernoulli formula.