## Task 6A - 291246A

In two urns $A$ and $B$, there are exactly $m$ red and exactly $n$ blue balls in total. The total number of balls is greater than 2; at least one of the balls is red.

At the beginning, $A$ contains all the red and $B$ all the blue balls.

By alternately taking one randomly selected ball from $A$ and $B$ and placing it in the other urn, the balls are to be mixed.

The process begins with the removal from urn $A$.

Determine all pairs $(m ; n)$ of the numbers $m$ and $n$ for which the fourth ball moved has a probability of $\frac{1}{2} 2$ of being red.

Hint:

If an urn contains exactly $Z$ balls, then by random selection of a ball, it is understood that the probability of selecting any of the $Z$ balls is $\frac{1}{Z}$.

More generally, if from $M$ possible events $G$ are considered favorable and $M-G$ are considered unfavorable, and all $M$ events are equally likely, then the probability of a favorable event occurring is $\frac{G}{M}$.
1. For every move where a ball is placed from urn $A$ into urn $B$, there are exactly $m$ equally likely possibilities; for a move where a ball is placed from $B$ into $A$, there are exactly $n+1$ equally likely possibilities.

In total, there are therefore exactly $m^{2}(n+1)^{2}$ different equally likely possibilities for the sequence of the first four moves.

2. We now determine the number of possibilities for drawing a red or a blue ball in the first to fourth moves:

For the case where a red ball is drawn in the 1st move, there are exactly $m$ possibilities (drawing a blue ball, 0 possibilities).

In the 2nd move, for each of the $m$ (possible) cases from the 1st move, there are exactly $n$ possibilities to draw a blue ball and exactly one possibility to draw a red ball.

In the 3rd move, for each of the $n \cdot m$ cases (where a blue ball was drawn in the 2nd move), there are $(m-1)$ possibilities to draw a red ball and 1 possibility to draw a blue ball. For each of the $1 \cdot m$ cases (where a red ball was drawn in the 2nd move), there are $m$ possibilities to draw a red ball and 0 possibilities to draw a blue ball.

Finally, in the 4th move, for each of the $(m-1) \cdot n \cdot m$ cases (2nd move blue, 3rd move red), there are 2 possibilities to draw a red (and $n-1$ possibilities to draw a blue) ball; for each of the $1 \cdot n \cdot m$ cases (2nd and 3rd move blue), there is exactly 1 possibility to draw a (and $n$ possibilities to draw a blue) ball; for each of the $m \cdot 1 \cdot m$ (2nd and 3rd move red) cases, there is exactly 1 possibility to draw a red (and $n$ possibilities to draw a blue) ball.

Thus, the number $S$ of favorable cases (i.e., a red ball is drawn in the 4th move) is:

$$
S=2 \cdot(m-1) \cdot n \cdot m+1 \cdot 1 \cdot n \cdot m+1 \cdot m \cdot 1 \cdot m
$$

Therefore, we need to find all integer pairs $(m ; n)$ for which

$$
\frac{m \cdot n+2(m-1) n \cdot m+m^{2}}{m^{2}(n+1)^{2}}=\frac{1}{2}
$$

is true. Since $m \neq 0$, this equation holds exactly when

$$
m-2 n+2 m n-m n^{2}=0
$$

is true, which implies that on the one hand, $m$ is a divisor of $2 n$, and on the other hand, $m$ is divisible by $n$. Thus, $m=t \cdot n$ with $t=1$ or $t=2$. For $t=1$, equation $\left(^{*}\right)$ becomes

$$
-n+2 n^{2}-n^{3}=0 \quad \text { or } \quad n \cdot(n-1)^{2}=0
$$

This equation has no solution because $n=m$ and $n+m>2$. The case $t=2$, however, leads to $4 n^{2}-2 n^{3}=0$, from which $n=2, m=4$ follows immediately.

These numbers indeed satisfy the original equation. Therefore, the only configuration that meets the requirement in the problem is 4 red and 2 blue balls.