Subfield: Combinatorics


Question: Let $n$ be a positive integer. Two players $A$ and $B$ play a game in which they take turns choosing positive integers $k \leqslant n$. The rules of the game are:

(i) A player cannot choose a number that has been chosen by either player on any previous turn.

(ii) A player cannot choose a number consecutive to any of those the player has already chosen on any previous turn.

(iii) The game is a draw if all numbers have been chosen; otherwise the player who cannot choose a number anymore loses the game.

The player $A$ takes the first turn. Determine the outcome of the game, assuming that both players use optimal strategies.

Solution:
For brevity, we denote by $[n]$ the set $\{1,2, \ldots, n\}$.

Firstly, we show that $B$ wins whenever $n \neq 1,2,4,6$. For this purpose, we provide a strategy which guarantees that $B$ can always make a move after $A$ 's move, and also guarantees that the game does not end in a draw.

We begin with an important observation.

Lemma. Suppose that $B$ 's first pick is $n$ and that $A$ has made the $k^{\text {th }}$ move where $k \geqslant 2$. Then $B$ can also make the $k^{\text {th }}$ move.

Proof. Let $\mathcal{S}$ be the set of the first $k$ numbers chosen by $A$. Since $\mathcal{S}$ does not contain consecutive integers, we see that the set $[n] \backslash \mathcal{S}$ consists of $k$ "contiguous components" if $1 \in \mathcal{S}$, and $k+1$ components otherwise. Since $B$ has chosen only $k-1$ numbers, there is at least one component of $[n] \backslash \mathcal{S}$ consisting of numbers not yet picked by $B$. Hence, $B$ can choose a number from this component.

We will now describe a winning strategy for $B$, when $n \neq 1,2,4,6$. By symmetry, we may assume that $A$ 's first choice is a number not exceeding $\frac{n+1}{2}$. So $B$ can pick the number $n$ in $B$ 's first turn. We now consider two cases.

Case 1. $n$ is odd and $n \geqslant 3$. The only way the game ends in a draw is that $A$ eventually picks all the odd numbers from the set $[n]$. However, $B$ has already chosen $n$, so this cannot happen. Thus $B$ can continue to apply the lemma until $A$ cannot make a move.

Case 2. $n$ is even and $n \geqslant 8$. Since $B$ has picked $n$, the game is a draw only if $A$ can eventually choose all the odd numbers from the set $[n-1]$. So $B$ picks a number from the set $\{1,3,5, \ldots, n-3\}$ not already chosen by $A$, on $B$ 's second move. This is possible since the set consists of $\frac{n-2}{2} \geqslant 3$ numbers and $A$ has chosen only 2 numbers. Hereafter $B$ can apply the lemma until $A$ cannot make a move.

Hence, in both cases $A$ loses.

We are left with the cases $n=1,2,4,6$. The game is trivially a draw when $n=1,2$. When $n=4, A$ has to first pick 1 to avoid losing. Similarly, $B$ has to choose 4 as well. It then follows that the game ends in a draw.

When $n=6, B$ gets at least a draw by the lemma or by using a mirror strategy. On the other hand, $A$ may also get at least a draw in the following way. In the first turn, $A$ chooses 1 . After $B$ 's response by a number $b, A$ finds a neighbor $c$ of $b$ which differs from 1 and 2 , and reserves $c$ for $A$ 's third move. Now, clearly $A$ can make the second move by choosing a number different from $1,2, c-1, c, c+1$. Therefore $A$ will not lose.

Final answer: The game ends in a draw when $n=1,2,4,6$; otherwise $B$ wins