HOME

TheInfoList



OR:

In
combinatorial game theory Combinatorial game theory is a branch of mathematics and theoretical computer science that typically studies sequential games with perfect information. Study has been largely confined to two-player games that have a ''position'' that the playe ...
, a subtraction game is an
abstract strategy game Abstract strategy games admit a number of definitions which distinguish these from strategy games in general, mostly involving no or minimal narrative theme, outcomes determined only by player choice (with no randomness), and perfect information ...
whose state can be represented by a
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called '' cardinal ...
or
vector Vector most often refers to: *Euclidean vector, a quantity with a magnitude and a direction *Vector (epidemiology), an agent that carries and transmits an infectious pathogen into another living organism Vector may also refer to: Mathematic ...
of numbers (for instance, the numbers of game tokens in piles of tokens, or the positions of pieces on board) and in which the allowed moves reduce these numbers., "Subtraction games", pp. 83–86. Often, the moves of the game allow any number to be reduced by subtracting a value from a specified ''subtraction set'', and different subtraction games vary in their subtraction sets. These games also vary in whether the last player to move wins (the normal play convention) or loses ( misère play convention). Another winning convention that has also been used is that a player who moves to a position with all numbers zero wins, but that any other position with no moves possible is a draw.


Examples

Examples of notable subtraction games include the following: *
Nim Nim is a mathematical two player game. Nim or NIM may also refer to: * Nim (programming language) * Nim Chimpsky, a signing chimpanzee Acronyms * Network Installation Manager, an IBM framework * Nuclear Instrumentation Module * Negative index met ...
is a game whose state consists of multiple piles of tokens, such as coins or matchsticks, and a valid move removes any number of tokens from a single pile. Nim has a well-known optimal strategy in which the goal at each move is to reach a set of piles whose nim-sum is zero, and this strategy is central to the Sprague–Grundy theorem of optimal play in
impartial game In combinatorial game theory, an impartial game is a game in which the allowable moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric. In other words, the only difference betw ...
s. However, when playing only with a single pile of tokens, optimal play is trivial (simply remove all the tokens in a single move). *
Subtract a square Subtract-a-square (also referred to as take-a-square) is a two-player mathematical subtraction game. It is played by two people with a pile of coins (or other tokens) between them. The players take turns removing coins from the pile, always removi ...
is a variation of nim in which only square numbers of tokens can be removed in a single move. The resulting game has a non-trivial strategy even for a single pile of tokens; the
Furstenberg–Sárközy theorem In mathematics, a square-difference-free set is a set of natural numbers, no two of which differ by a square number. Hillel Furstenberg and András Sárközy proved in the late 1970s the Furstenberg–Sárközy theorem of additive number the ...
implies that its winning positions have density zero among the integers. * Fibonacci nim is another variation of nim in which the allowed moves depend on the previous moves to the same pile of tokens. On the first move to a pile, it is forbidden to take the whole pile, and on subsequent moves, the amount subtracted must be at most twice the previous amount removed from the same pile. * Wythoff's game is played by placing a chess queen on a large chessboard and, at each step, moving it (in the normal manner of a chess queen) towards the bottom side, left side, or bottom left corner of the board. This game may be equivalently described with two piles of tokens, from which each move may remove any number of tokens from one or both piles, removing the same amount from each pile when both piles are reduced. It has an optimal strategy involving Beatty sequences and the
golden ratio In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Expressed algebraically, for quantities a and b with a > b > 0, where the Greek letter phi ( ...
.


Theory

Subtraction games are generally
impartial game In combinatorial game theory, an impartial game is a game in which the allowable moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric. In other words, the only difference betw ...
s, meaning that the set of moves available in a given position does not depend on the player whose turn it is to move. For such a game, the states can be divided up into \mathcal-positions (positions in which the previous player, who just moved, is winning) and \mathcal-positions (positions in which the next player to move is winning), and an optimal game playing strategy consists of moving to a \mathcal-position whenever this is possible. For instance, with the normal play convention and a single pile of tokens, every number in the subtraction set is an \mathcal-position, because a player can win from such a number by moving to zero. For normal-play subtraction games in which there are multiple numbers, in which each move reduces only one of these numbers, and in which the reductions that are possible from a given number depend only on that number and not on the rest of the game state, the Sprague–Grundy theorem can be used to calculate a "nim value" of each number, a number representing an equivalent position in the game of nim, such that the value of the overall game state is the nim-sum of its nim-values. In this way, the optimal strategy for the overall game can be reduced to the calculation of nim-values for a simplified set of game positions, those in which there is only a single number. The nim-values are zero for \mathcal-positions, and nonzero for \mathcal-positions; according to a theorem of Tom Ferguson, the single-number positions with nim-value one are exactly the numbers obtained by adding the smallest value in the subtraction set to a \mathcal-position. Ferguson's result leads to an optimal strategy in multi-pile misère subtraction games, with only a small amount of change from the normal play strategy. For a subtraction game with a single pile of tokens and a fixed (but possibly infinite) subtraction set, if the subtraction set has arbitrarily large gaps between its members, then the set of \mathcal-positions of the game is necessarily infinite. For every subtraction game with a finite subtraction set, the nim-values are bounded and both the partition into \mathcal-positions and \mathcal-positions and the sequence of nim-values are eventually periodic. The period may be significantly larger than the maximum value x in the subtraction set, but is at most 2^x., Example (a), p. 454; However, there exist infinite subtraction sets that produce bounded nim-values but an aperiodic sequence of these values.


Complexity

For subtraction games with a fixed (but possibly infinite) subtraction set, such as subtract a square, the partition into P-positions and N-positions of the numbers up to a given value n may be computed in time O(n\log^2 n). The nim-values of all numbers up to n may be computed in time O(\min(ns,nm\log^2 n)) where s denotes the size of the subtraction set (up to n) and m denotes the largest nim-value occurring in this computation. For generalizations of subtraction games, played on vectors of natural numbers with a subtraction set whose vectors can have positive as well as negative coefficients, it is an
undecidable problem In computability theory and computational complexity theory, an undecidable problem is a decision problem for which it is proved to be impossible to construct an algorithm that always leads to a correct yes-or-no answer. The halting problem is ...
to determine whether two such games have the same P-positions and N-positions.


See also

* Grundy's game and
octal game The octal games are a class of two-player games that involve removing tokens (game pieces or stones) from heaps of tokens. They have been studied in combinatorial game theory as a generalization of Nim, Kayles, and similar games. Revised and reprin ...
s, generalizations of subtraction games in which a move may split a pile of tokens in two


Notes


References

* * * * * * * * * * * *{{citation , last = Wythoff , first = W. A. , author-link = Willem Abraham Wythoff , issue = 2 , journal = Nieuw Archief voor Wiskunde , pages = 199–202 , title = A modification of the game of nim , url = https://archive.org/details/nieuwarchiefvoo02genogoog/page/n219/mode/2up , volume = 7 , year = 1907 Combinatorial game theory