Ilya Muromets meets the three-headed Zmei Gorynych. And the battle begins. Every minute Ilya cuts off one of Zmei's heads. With a probability of $1 / 4$, two new heads grow in place of the severed one, with a probability of $1 / 3$ only one new head grows, and with a probability of $5 / 12$ - no heads grow. The Zmei is considered defeated if he has no heads left. Find the probability that Ilya will eventually defeat the Zmei.
Blows by Ilya Muromets, in which the number of heads changes, are called successful.

Let's find the probability that at some point there will be a last successful blow. This means that starting from this point, there will be no more successful blows, that is, all blows will be unsuccessful. The probability of this is $1 / 3 \cdot 1 / 3 \cdot 1 / 3 \cdot \ldots=0$.

Thus, there will be no last successful blow, but there will be an infinite subsequence of successful blows, which we will consider, ignoring all other blows.

The probability of a successful blow is $2 / 3$. The conditional probability that the number of heads increases when a successful blow occurs is $1 / 4: 2 / 3=3 / 8$.

Similarly, the conditional probability that the number of heads decreases when a successful blow occurs is $5 / 12: 2 / 3=5 / 8$.

A standard one-dimensional random walk problem arises. Suppose that as a result of a certain series of successful blows, the number of the Dragon's heads has decreased by one compared to what it was. Let's call this event $D$, and its probability $x$.

There are two possibilities.

1) As a result of the first successful blow, the number of heads decreased by one (event $M$, probability $5 / 8$). In this case, event $D$ has already occurred - its conditional probability is 1.
2) As a result of the first successful blow, the number of heads increases by one (event $N$, probability $3 / 8$). In this case, event $D$ will occur only if the number of heads decreases by 2 - by one, and then by another one. Therefore, the conditional probability of event $D$ in this case is $x^{2}$.

By the formula of total probability $x=\mathrm{P}(D)=\mathrm{P}(D \mid M) \cdot \mathrm{P}(M)+\mathrm{P}(D \mid N) \cdot \mathrm{P}(N)=5 / 8+3 / 8 x^{2}$.

From this, $x=1$ or $x=5 / 3$. The second root is extraneous. Therefore, event $D$ is certain.

Thus, sooner or later, the number of heads will inevitably decrease from three to two. Then, for the same reason, the number of heads will decrease to one and, finally, become zero. The Dragon has no chance.

## Answer