15. Messengers (recommended for 9th grade, 3 points). Once, the beautiful Queen Guinevere, while staying at her parental castle, asked King Arthur to send her 20 pearls. The roads are not safe, and Arthur, just in case, decided to send 40 pearls, with different messengers, ordering them to ride on different roads. Bandits may lie in wait for the messengers. The probability that each individual messenger will be robbed is $p$, independently of the chosen road and the fate of other messengers $(0<p<1)$.

The king is in a dilemma: should he send two messengers, giving each 20 pearls, send three messengers, giving one 20 and the other two 10 pearls each, or send four messengers, giving each 10 pearls? Which option should the king choose so that the queen has the highest probability of receiving at least 20 pearls?
Solution. The probability of not saving at least 20 pearls if there are two messengers:

$$
\mathrm{P}_{2}=p^{2}
$$

The probability of not saving at least 20 pearls if there are three messengers:

$$
\mathrm{P}_{3}=p^{3}+2 p^{2}(1-p)=p^{2}(2-p) .
$$

The probability of not saving at least 20 pearls if there are four messengers:

$$
\mathrm{P}_{4}=p^{4}+4 p^{3}(1-p)=p^{3}(4-3 p)
$$

Dividing all probabilities by \( p^{2} \), we get three functions:

$$
f_{2}=1, f_{3}=2-p, f_{4}=4 p-3 p^{2}
$$

Clearly, \( f_{2}<f_{3} \) for all \( p \in(0 ; 1) \) (Fig. 6), so the option with three messengers is inferior under any conditions. Let's compare \( f_{2} \) and \( f_{4} \):

$$
1<4 p-3 p^{2} ; 3 p^{2}-4 p+1<0, \text { hence } \frac{1}{3}<p<1
$$

Thus, when \( 0<p<\frac{1}{3} \), it is more advantageous to send four messengers, and when \( \frac{1}{3} \leq p<1 \) - two. In fact, when \( p=\frac{1}{3} \), two or four messengers will perform equally well, but why send four messengers if two are sufficient?

Answer: when \( 0<p<\frac{1}{3} \), it is more advantageous to send four messengers, and when \( \frac{1}{3} \leq p<1 \) - two.

![](https://cdn.mathpix.com/cropped/2024_05_06_e14c9bd69fbda0eec36cg-16.jpg?height=488&width=463&top_left_y=1592&top_left_x=1456)

Fig. 6.