Search in Co-Wiki

Kayles

game-theory 928 tokens 7 outbound links

Kayles

Rules Kayles is played with a row of tokens, which represent bowling pins. The row may be of any length. The two players alternate; each player, on his or her turn, may remove either any one pin (a ball bowled directly at that pin), or two adjacent pins (a ball bowled to strike both). Under the normal play convention, a player loses when they have no legal move (that is, when all the pins are gone). The game can also be played using misère rules; in this case, the player who cannot move wins.

History Kayles was invented by Henry Dudeney. Richard Guy and Cedric Smith were first to completely analyze the normal-play version, using Sprague-Grundy theory. The misère version was analyzed by William Sibert in 1973, but he did not publish his work until 1989.

The name "Kayles" is an Anglicization of the French quilles, meaning "bowling pins".

Analysis Most players quickly discover that the first player has a guaranteed win in normal Kayles whenever the row length is greater than zero. This win can be achieved using a symmetry strategy. On their first move, the first player should move so that the row is broken into two sections of equal length. This restricts all future moves to one section or the other. Now, the first player merely imitates the second player's moves in the opposite row.

It is more interesting to ask what the nim-value is of a row of length <math>n</math>. This is often denoted <math>K_n</math>; it is a nimber, not a number. By the sprague–grundy-theorem, <math>K_n</math> is the mex over all possible moves of the nim-sum of the nim-values of the two resulting sections. For example,

: <math>K_5 = \mbox{mex}\{K_0 + K_4, K_1 + K_3, K_2 + K_2, K_0 + K_3, K_1 + K_2\},\,</math>

because from a row of length 5, one can move to the positions

: <math>K_0 + K_4,\quad K_1 + K_3,\quad K_2 + K_2,\quad K_0 + K_3,\text{ and } K_1 + K_2.\,</math>

Recursive calculation of values (starting with <math>K_0 = 0</math>) gives the results summarized in the following table. To find the value of <math>K_n</math> on the table, write <math>n</math> as <math>12a + b</math>, and look at row a, column b:

At this point, the nim-value sequence becomes periodic it is helpful to understand Kayles in order to analyze a generic dots and boxes position.

Computational complexity Under normal play, Kayles can be solved in polynomial time using Sprague-Grundy theory.,. Alternatively, this game can be viewed as two players finding an independent set together. Winner determination of the normal variant (the last to play wins) is solvable in polynomial time for any family of graphs with bounded asteroidal number (defined as the size of a largest subset of vertices such that the removal of the closed neighborhood of any vertex in the set leaves the remaining vertices of the set in the same connected component). proved in 1978 that deciding the outcome of these games is PSPACE-complete (the same holds for the partisan versions, in which, for every vertex, only one of the players is allowed to choose it as the knock down target). The misère variants of these game were proved PSPACE-complete in 2024 and the optimization variants in 2025 .

See also * [[combinatorial-game-theory]] * Octal games * Dawson's Kayles * [[nimber]]

References <references />