17. Durability of Zmey Gorynych. Ilya Muromets meets a three-headed Zmey Gorynych. Every minute, Ilya cuts off one of Zmey's heads. Let $x$ be the durability of Zmey ($x > 0$). The probability that $s$ new heads will grow in place of the cut head $(s=0,1,2)$ is

$$
p_{s}=\frac{x^{s}}{1+x+x^{2}}
$$

During the first 10 minutes of the battle, Ilya recorded how many heads grew back in place of each one he cut off. The resulting vector is:

$$
K=(1,2,2,1,0,2,1,0,1,2)
$$

Find the value of Zmey's durability such that the probability of the vector $K$ is maximized 9.
Solution. Due to the mutual independence of head regrowth (the number of heads that have grown back depends only on the survivability, but not on previous events), the probability of the vector $K$ is $\mathrm{P}(K)=p_{1} p_{2} p_{2} p_{1} p_{0} p_{2} p_{1} p_{0} p_{1} p_{2}=\frac{x^{12}}{\left(1+x+x^{2}\right)^{10}}$.

This is a function of $x$. We need to find the point at which this function takes the maximum value on the ray $(0 ;+\infty)$.

Let's find the derivative:

$$
\mathrm{P}^{\prime}=\frac{12 x^{11}\left(1+x+x^{2}\right)^{10}-10\left(1+x+x^{2}\right)^{9}(1+2 x) x^{12}}{\left(1+x+x^{2}\right)^{20}}=-\frac{2 x^{11}\left(4 x^{2}-x-6\right)}{\left(1+x+x^{2}\right)^{11}}
$$

Setting the derivative to zero, we get the only positive root of the equation: $x_{0}=\frac{\sqrt{97}+1}{8} \approx 1.36$. For $0<x<x_{0}$, the derivative is positive, and for $x>x_{0}$, it is negative. Therefore, the found point is the only maximum point, so the function $\mathrm{P}$ takes the maximum value only at this point.

Answer: $\frac{\sqrt{97}+1}{8} \approx 1.36$.[^7]