Ilya Muromets meets the three-headed Zmei Gorynych. Every minute, Ilya cuts off one head of the Zmei. Let $x$ be the resilience of the Zmei ($x>0$). The probability $p_{s}$ that $s$ new heads will grow in place of the cut head ($s=0,1$, 2) is $\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. The resulting vector is $K=(1,2,2,1,0,2,1,0,1,2)$. Find the value of the Zmei's resilience such that the probability of the vector $K$ is maximized.
Due to the mutual independence of head regrowth (the number of heads that have grown back depends only on vitality, but not on previous events), the probability of vector $K$ is $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}}=\mathrm{P}(x)$. We need to find the point where this function takes its maximum value on the ray $(0,+\infty)$.

$\mathrm{P}^{\prime}(x)=\frac{12 x^{11}\left(1+x+x^{2}\right)^{10}-10\left(1+x+x^{2}\right)^{9}(1+2 x)}{\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}}$.

By setting the derivative to zero, we obtain the only positive root $x_{0}=\frac{\sqrt{97}+1}{8} \approx 1.36$.

Since $\mathrm{P}(x) \geq 0, \mathrm{P}(0)=0$ and $\mathrm{P}(x) \rightarrow 0$

as $x \rightarrow \infty$, $x_{0}$ is the only point of maximum.

## Answer

$\frac{\sqrt{97}+1}{8} \approx 1.36$