[Math] Generalized tic-tac-toe

co.combinatoricscombinatorial-game-theoryrecreational-mathematics

We begin with $2n+1$ cards, each with a distinct number from $-n$ to $+n$ on it, face up in between the two players of the game. The players take turns selecting a card and keeping it. The first player to collect three cards that sum to zero wins the game. If the cards are exhausted and neither player has won, a draw is declared.

Tic-tac-toe, or noughts and crosses, is of course the special case $n=4$, by using the essentially unique $3\times3$ magic square:

$$\begin{matrix} 3 & -4 & 1 \\\ -2 & 0 & 2 \\\ -1 & 4& -3\end{matrix}$$

Has the case of general $n$ been studied?

Best Answer

First player wins for $n$ at least five. First turn, name $0$. They name a number, say $-a$. Choose two numbers $b$ and $c$ such that neither $b$, $c$, nor $b+c=a$. Then name $b$, forcing them to name $-b$, then $c$, forcing them to name $-c$, then $-b-c$, winning. You can always choose two such numbers, since each positive number is missed by one of the following triples: $1+2=3, 1+3=4, 1+4=5, 2+3=5$.

As quid points out, this is more complicated than I originally made it seem. If $c\neq a+b$ but $a+b$ is in the interval, then the second player can name $a+b$ in response to $c$ and win.

To avoid this, if $1 <a\leq n-2$, choose $b=1$ and $c=a+1$. Neither $1$, $a+1$, nor $a+2=a$ so this works.

If $a\geq n-1$, choose $b=2$ and $c=1$. Since $n\geq 5$, neither $1$, $2$, nor $3=a$ so this works, and $a+b=a+2>n$.

If $a=1$, choose $b=2$ and $c=3$, so $c=a+b$ and neither $2$, $3$, nor $5=a$.