# Solution.

a) The desired event occurs only if the first four shots hit two targets, and the last shot was successful. The probability of this is

$$
C_{4}^{2} p^{2}(1-p)^{2} \cdot p=6 p^{3}(1-p)^{2}
$$

b) Note that with a hit probability of $p$, the average number of shots needed to hit the first target is $1 / p$. This is intuitively clear and strictly follows from the properties of the geometric distribution. Therefore, on average, another $1 / p$ shots will be needed for the second target and the same for the third.

Answer: a) $6 p^{3}(1-p)^{2}$; b) $\frac{3}{p}$.
6. Three targets. A shooter shoots at three targets until all are hit. The probability of hitting a target with one shot is $p$.

a) (from 7th grade. 2 points). Find the probability that exactly 5 shots will be required.

b) (from 8th grade. 2 points). Find the expected number of shots.