Guaranteed successful strategies for a square achievement game on an n by n grid

Reading time: 6 minute
...

📝 Original Info

  • Title: Guaranteed successful strategies for a square achievement game on an n by n grid
  • ArXiv ID: 1109.2341
  • Date: 2012-05-22
  • Authors: Thomas Jenrich

📝 Abstract

At some places (see the references) Martin Erickson describes a certain game: "Two players alternately write O's (first player) and X's (second player) in the unoccupied cells of an n x n grid. The first player (if any) to occupy four cells at the vertices of a square with horizontal and vertical sides is the winner." Then he asks "What is the outcome of the game given optimal play?" or "What is the smallest n such that the first player has a winning strategy?" For n lower than 3 a win is obviously impossible. The aim of this article and the additionally (in the source package) provided computer program SQRGAME2 is to give and prove sure strategies for the second player not to lose if n is 3 or 4, and for the first player to win if n is 5.

💡 Deep Analysis

📄 Full Content

At some places (see the references) Martin Erickson describes a certain game: "Two players alternately write O's (first player) and X's (second player) in the unoccupied cells of an n x n grid. The first player (if any) to occupy four cells at the vertices of a square with horizontal and vertical sides is the winner." Then he asks "What is the outcome of the game given optimal play?" or "What is the smallest n such that the first player has a winning strategy?" For n lower than 3 a win is obviously impossible. The aim of this article and the additionally (in the source package) provided computer program SQRGAME2 (as a revision of its incorrect predecessor SQRGAME) is to give and prove sure strategies for the second player not to lose if n is 3 or 4, and for the first player to win if n is 5. This article has been updated only because it turned out that SQRGAME was incorrect. You can find the details in the paragraph beginning with "The predecessor SQRGAME " within the section "The provided computer program SQRGAME2".

To prepare the use of a computer program to check all possible cases this description of the game is given: Let G be a two-dimensional array variable with integer index ranges from 0 to (at least) n -1 and possible cell values 0, 1 and 2. The current value of a cell addressed by a row number r and a column number c is denoted by G[r, c] where r and c have to be integer values from 0 to n -1, sometimes presented as a position (r,c). The game starts with G[r, c] = 0 for all integers r and c from 0 to n -1. Player 1 and player 2 alternately change the value of a single cell of G at some permitted position from 0 to 1 or 2, respectively. For v = 1 or v = 2, player v wins the game if he is the first to achieve that there are non-negative integers r and c and a positive integer

That winning four-cells-configuration will be shortly called a square (of size d) here and in the source code of the provided computer program. It is easy to verify that rotating the content of G by steps of 90 degrees or mirroring it with respect to the columns, the rows, or one of the diagonals preserves existing squares (and their sizes) and does not establish new ones.

Because we want to consider only optimal playing and try to reduce the lengths and number of different game runs we require: When a player has to make his move:

If he can win by completing a square he wins instantly.

Otherwise:

If there are two (or more) different positions his opponent could use with his next move to complete a square (a situation further called a dilemma) the currently active player loses instantly.

Otherwise:

If there is one such position the currently active player has to occupy that position.

Otherwise:

If the currently active player can complete a dilemma (against his opponent) he wins instantly.

Otherwise:

As long as the content of G is symmetric with respect to the columns (meaning G[r, c] = G[r, n -1 -c] for all allowed positions (r,c)) no move is allowed using a column number c > ((n -1) div 2), where div is the infix operator delivering the integer part of the quotient of the two operands.

G is obviously symmetric at the start of the game and stays symmetric as long as there are only moves using the column number (n -1)/2 , requiring n to be odd.

For the position (r,c) of the first move of the game, r is not allowed to be greater than c. If n is odd and the first move has used the middle cell at position (n div 2, n div 2) that applies also to the second move.

For v = 1 or v = 2, player v can not win if no possible square having no vertex occupied by his opponent is left. So in this case one can stop the game instantly if it is the aim to show whether player v can win or his opponent can prevent a loss.

For some given n (in the current version 3, 4, and 5) SQRGAME2 is used to check whether player 1 can win or player 2 can prevent to lose. It performs a search using a backtracking algorithm to investigate all possible game runs observing the restrictions given above. It does not try to find out whether player 2 could win.

The program integrates additional restrictions to player 2 in the cases n = 3 and n = 4 and additional restrictions to player 1 in the case n = 5. The execution of the program will show that player 2 reaches his aim in the cases n = 3 and n = 4, and player 1 reaches his aim in the case n = 5, while the successful players don’t perform any actual backtrackings.

In the case n=4 player 2 and in the case n=5 player 1 is required to occupy a free position that now or later could become a vertex of a possible square for player 1 if such a position exists and the prior position selection rules don’t apply.

In the case n = 5 the maximum number of moves in a game is restricted: Instead of the natural limit, the number of cells n 2 = 25, much smaller values are used: If the second move uses the position (0,2) the maximum value is set to 17, if the position is (0,0) or (1,2) to 13, otherwise to 11. These l

Reference

This content is AI-processed based on open access ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut