[ Equations in integers ]

$$
\text { [ Game theory_(miscellaneous). ] }
$$

## Auto: Chebotarev A.S.

A player has $m$ gold and $n$ silver coins. At the beginning of each round, the player bets some coins on red and some on black (it is possible to bet nothing on one of the colors, and some coins can be left unbet). At the end of each round, the croupier announces which color has won. The croupier returns the bet on the winning color to the player, doubling the number of coins of each type in it, while the bet on the losing color is taken by the croupier. The player wants to have exactly three times as many coins of one type as the other (in particular, it would be acceptable for him to end up with no money at all). For which $m$ and $n$ will the croupier be unable to prevent this?

#
Let before some round a player has $a$ gold and $b$ silver coins. Let's see what happens to $a$ and $b$ in one round. Suppose the player bet $x$ gold and $p$ silver on red, and $y$ gold and $q$ silver on black. Then, depending on the dealer's choice, either the number of gold coins will increase by $z=x-y$, and silver by $r=p-q$, or the number of coins of each type will decrease by these numbers. Clearly, $|z| \leq a$ and $|r| \leq b$ and any $z$ and $r$ within these ranges can be achieved.

Assume $a>3 b$. Then the dealer can ensure that this inequality is maintained even after the round. Indeed, if it is violated by any choice of the dealer, then $a-z<3(b-r)$ and $a+z<3(b+r)$. Adding these inequalities, we get that $2 a<6 b$, which is not true. Therefore, if at the beginning the number of coins differs by more than 3 times, the dealer can make sure that they always differ by more than 3 times. The problem is already solved when $m=3 n$ or $n=3 m$. It remains to consider the case when $m<3 n$ and $n<3 m$. Let's try to find $z$ and $r$ such that the ratio of the number of coins becomes 3 regardless of the outcome. We form a system of equations: $a+z=3(b+r), 3(a-z)=b-r$. Solving it, we find: $z=5 a / 4-3 b / 4, r=3 a / 4-5 b / 4$. For $a$ and $b$ differing by less than 3 times, $|z|<a,|r|<b$. Note that if $a+b$ is divisible by 4, then $z$ and $r$ will also be integers. Therefore, in this case, the player can achieve the goal in one round.

It remains to show that the player can make $a+b$ divisible by 4. Indeed, by betting all the coins on red, the player can ensure that either everything is lost (which suits him), or the total number of coins is doubled.

## Answer

When $a$ and $b$ differ by no more than 3 times.