Kayles is a simple impartial game in combinatorial game theory, invented by Henry Dudeney in 1908. Given a row of imagined bowling pins, players take turns to knock out either one pin, or two adjacent pins, until all the pins are gone. Using the notation of octal games, Kayles is denoted 0.77.
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.
Kayles was invented by Henry Dudeney.[1] [2] Richard Guy and Cedric Smith were first to completely analyze the normal-play version, using Sprague-Grundy theory.[3] [4] 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".
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
n
Kn
Kn
K5=mex\{K0+K4,K1+K3,K2+K2,K0+K3,K1+K2\},
because from a row of length 5, one can move to the positions
K0+K4, K1+K3, K2+K2, K0+K3,andK1+K2.
Recursive calculation of values (starting with
K0=0
Kn
n
12a+b
Kn | width=20 | 0 | width=20 | 1 | width=20 | 2 | width=20 | 3 | width=20 | 4 | width=20 | 5 | width=20 | 6 | width=20 | 7 | width=20 | 8 | width=20 | 9 | width=20 | 10 | width=20 | 11 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0+ | 0 | 1 | 2 | 3 | 1 | 4 | 3 | 2 | 1 | 4 | 2 | 6 | ||||||||||||
12+ | 4 | 1 | 2 | 7 | 1 | 4 | 3 | 2 | 1 | 4 | 6 | 7 | ||||||||||||
24+ | 4 | 1 | 2 | 8 | 5 | 4 | 7 | 2 | 1 | 8 | 6 | 7 | ||||||||||||
36+ | 4 | 1 | 2 | 3 | 1 | 4 | 7 | 2 | 1 | 8 | 2 | 7 | ||||||||||||
48+ | 4 | 1 | 2 | 8 | 1 | 4 | 7 | 2 | 1 | 4 | 2 | 7 | ||||||||||||
60+ | 4 | 1 | 2 | 8 | 1 | 4 | 7 | 2 | 1 | 8 | 6 | 7 | ||||||||||||
72+ | 4 | 1 | 2 | 8 | 1 | 4 | 7 | 2 | 1 | 8 | 2 | 7 |
Because certain positions in dots and boxes reduce to Kayles positions,[5] it is helpful to understand Kayles in order to analyze a generic dots and boxes position.
Under normal play, Kayles can be solved in polynomial time using Sprague-Grundy theory.
Node Kayles is a generalization of Kayles to graphs in which each bowl “knocks down” (removes) a desired vertex and all its neighboring vertices. Alternatively, this game can be viewed as two players finding an independent set together. Winner determination 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).[6]
Similarly, in the clique-forming game, two players must find a clique in the graph. The last to play wins. Schaefer (1978)[7] proved that deciding the outcome of these games is PSPACE-complete. The same result holds for a partisan version of node Kayles, in which, for every node, only one of the players is allowed to choose that particular node as the knock down target.