ArticleslgStudy

mathematics

Kayles

Kayles is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Kayles rather than just read about it. In short: 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.

Kayles — main illustration
Kayles — illustration

Key takeaways

  • Kayles belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Kayles to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Kayles from memory before moving on to harder problems.

Reference excerpt

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.

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 n {\displaystyle n} . This is often denoted K n {\displaystyle K_{n}} ; it is a nimber, not a number. By the Sprague–Grundy theorem, K n {\displaystyle K_{n}} is the mex over all possible moves of the nim-sum of the nim-values of the two resulting sections. For example,

K 5 = mex { K 0 + K 4 , K 1 + K 3 , K 2 + K 2 , K 0 + K 3 , K 1 + K 2 } , {\displaystyle K_{5}={\mbox{mex}}\{K_{0}+K_{4},K_{1}+K_{3},K_{2}+K_{2},K_{0}+K_{3},K_{1}+K_{2}\},\,}

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

K 0 + K 4 , K 1 + K 3 , K 2 + K 2 , K 0 + K 3 , and K 1 + K 2 . {\displaystyle 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}.\,}

Recursive calculation of values (starting with K 0 = 0 {\displaystyle K_{0}=0} ) gives the results summarized in the following table. To find the value of K n {\displaystyle K_{n}} on the table, write n {\displaystyle n} as 12 a + b {\displaystyle 12a+b} , and look at row a, column b:

At this point, the nim-value sequence becomes periodic with period 12, so all further rows of the table are identical to the last row.

Applications Because certain positions in dots and boxes reduce to Kayles positions, 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.

Generalizations In the generalization of Kayles to graphs, 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 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). Similarly, in the clique-forming game, two players must find a clique in the graph. In the normal variant (the last to play wins), Schaefer 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

Illustrations

Kayles: A row of bowling pins. On their turn, a player may choose to eliminate a single pin, or two adjacent ones.
A row of bowling pins. On their turn, a player may choose to eliminate a single pin, or two adjacent ones.

Worked examples

Example 1 — a first encounter with Kayles

Start with the simplest possible case. Write down what Kayles claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Kayles before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Kayles ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Kayles

In research
Kayles appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Kayles in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Kayles is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorial game theory, Mathematical games, so understanding it makes those chapters shorter.
In everyday life
Look for Kayles outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Kayles in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Kayles means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Kayles out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Kayles in simple terms?

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.

Why does Kayles matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Kayles?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Kayles.

Tags

  • Combinatorial game theory
  • Mathematical games

Keep exploring