Audamir

Five in a row: what follows from the measurements

Five in a row on a 15 × 15 board cannot be solved exactly. What holds about the first player, threats and forks and the AI levels, from games of AI against AI.

Five in a row is a preset of the game Lines: a 15 × 15 board, a line of five or longer wins. It has 225 cells and the game's solver stops at 64, so with perfect play it is not known who wins. All the numbers come from games of AI opponents.[1]

What holds

Five in a row by board size: first player wins, draws, second player winsThe share of the games that the first player won, that ended in a draw or that the second player won, on square boards with a line of 5 and no gravity, 100 games of the Normal AI against the Normal AI per board: 5 × 5 0 / 100 / 0; 6 × 6 0 / 100 / 0; 7 × 7 0 / 100 / 0; 8 × 8 11 / 89 / 0; 9 × 9 16 / 66 / 18; 10 × 10 43 / 40 / 17; 11 × 11 53 / 13 / 34; 12 × 12 39 / 12 / 49; 13 × 13 43 / 4 / 53; 15 × 15 49 / 0 / 51. On boards up to 7 × 7 every game is a draw, from 12 × 12 the second player wins about as often as the first.0%25%50%75%100%1005 × 51006 × 61007 × 711898 × 81666189 × 943401710 × 1053133411 × 1139124912 × 12435313 × 13495115 × 15first playerdrawsecond playerNormal AI against Normal AI, 100 games per board, one random stone of each player near the middle (numbers of games)
Five in a row by board size: first player wins, draws, second player wins
  • The solved small boards with a line of 5 (up to 6 × 4 and 5 × 5) are draws; 7 × 4, 6 × 5 and larger were not solved.[2]
  • The share of games won by the first player with AI opponents of equal level depends on how the game starts: Normal against Normal: the first player wins 100% from an empty board (22 different games of 40), 48% with two random stones; Strong against Strong 65% (and 12.5% draws) and 85%.[3]
  • Up to 7 × 7 every game is a draw, from 8 × 8 wins appear, from 12 × 12 the second player wins about as often as the first.[4]
  • Every level starts in the middle; the Normal and the Strong AI always answer diagonally next to it. A stone on the edge is the worst first move: the Strong AI won 4 of 14 games with it, otherwise 68 to 100%.[5]

Threats and the fork

  • A four: four stones in a window of five cells and the fifth free, the winning cell; the opponent must block it at once. The game's hint shows only fours.
  • An open three: a stone on one cell makes two winning cells at once; the opponent must answer at once.
  • A fork is a move after which the player wins within two further moves of their own, whatever the opponent answers: two fours, a four and a three, two threes.
The three kinds of fork in real positionsThree cuts of the 15 × 15 board from real games of the Strong AI against the Strong AI, the stones are numbered by the order of the moves. Left, two fours: the 19th move of the first player makes four stones in a row and in a column, and the opponent faces two winning cells at once. In the middle a four and a three: the 13th move makes a four with one winning cell and next to it a three that gives an open four after the forced block. Right, two threes: the 13th move makes two open threes at once and no move of the opponent stops both.Two fourstwo lines, two winning cells1234567891011121315161719A four and a threethe opponent must block the four12345678910111213Two threesthe marked cells are two threats1234567891213winning cella stone here makes two winning cellsthe move that made the fork
The three kinds of fork in real positions
  • The Normal and the Strong AI play their own fork almost always (483 of 484, 623 of 623), the Weak AI in 41% (82 of 200).
  • The games of the Normal and the Strong AI are decided by a fork that the opponent could no longer stop a move earlier (in 2 of 473 decided games it could).

Against the AI

All the numbers come from games of AI opponents; people were not measured.[6]

AIBlocks a fourAnswers a fork of the opponentThe player of rules wins
Weak56%12%100%
Normal100%99.9%35%
Strong100%100%16.7%
  • The player of rules (blocks a four, answers a fork, plays its own) stands in for a person.
  • A principle that was not measured: against the Weak AI it is enough to build lines and take a win (90%); against the Normal and the Strong AI it is not (1.7% and 0%).

Notes

  1. See (forthcoming article no. 66). ↩︎
  2. lines.js --solved --board LIST --nodes 300000000: 5 × 3, 5 × 4, 6 × 4 a draw; 7 × 4, 8 × 4, 6 × 5, 6 × 6 not solved; 5 × 5 with --nodes 4000000000 a draw; game 0.126.2. ↩︎
  3. lines.js --matrix --games 40 --variant gomoku and 160 games per pair with two random opening stones; game 0.126.2. ↩︎
  4. 100 games of the Normal AI against the Normal AI for each board size, one random stone of each player; game 0.126.2. ↩︎
  5. Fixed openings: 736 games of the Normal and 177 of the Strong AI against themselves (the first stone in a fixed class of cells, the answer within a distance of 2); game 0.126.2. ↩︎
  6. 960 games of the AI with two random stones and a threat detector written for the measurement; 60 games for each set of rules and level of the AI (30 as the first, 30 as the second player); game 0.126.2. ↩︎