Chess is a two-player board game believed to have been played in India as early as the sixth century AD. In different parts of this world, different chess games are played. The most played variants are western chess, shogi (in Japan), and xiangqi (in China).
The western version of chess is a game played on an board,
called a chessboard, of alternating black and white
squares. Pieces with different types of allowed moves
are placed on the board. White initially occupies ranks
1 and 2 and Black ranks 7 and 8. The pieces are called the bishop (2), king (1),
knight (2), pawn (8), queen (1), and rook (2). The object of the game
is to checkmate the opponent's king, placing it under attack so that the opponent
has no legal move (FIDE 2023, Articles 1.4-1.4.1).
In Ingmar Bergman's 1957 film classic The Seventh Seal, a Knight and his squire arrive home from the crusades to find Black Death sweeping their country. As they approach home, Death appears to the knight and tells him it is his time. The knight then challenges Death to a chess game for his life. Chess also appears as one of the games known to the WOPR computer in the 1983 film WarGames.
Hardy (1999, p. 17) estimated the number of possible games of chess as . Beeler et al. (1972, Problem 95)
estimated approximately
chess positions. A rough position count can be obtained by estimating pawn placements
(with no captures or promotions, this model gives
),
then accounting for the other pieces. Captures permit pawns to change files, producing
additional pawn placements (Schroeppel 1996). Shannon (1950) gave the rough piece-placement
estimate
This is an estimate of positions, rather than a count of move sequences or an exact count of legal positions. Separately, Shannon estimated game variations by allowing
about
possibilities for each pair of moves,
one by White and one by Black, over 40 such pairs.
Rex Stout's fictional detective Nero Wolfe quotes the number of possible games after ten moves as follows: "Wolfe grunted. One hundred and sixty-nine million,
five hundred and eighteen thousand, eight hundred and twenty-nine followed by twenty-one
ciphers. The number of ways the first ten moves, both sides, may be played"
(Stout 1983). The number of distinct chess diagrams after plies (half-moves) for
, 2, ... is 20, 400, 5362, 71852,
815677, 9260610, ... (Schwarzkopf 1994, OEIS A019319).
A diagram records the placement of the pieces without castling or en passant information.
The number of possible games after
plies, together with games ending
in checkmate before the
th
ply, for
, 2, 3, ... is 20, 400, 8902, 197281, 4865617, 119060679,
3195913043, ... (OEIS A006494). This convention
does not count termination by a draw. The alternative counts in OEIS A007545
use pseudo-legal move conventions, including king capture, with ordinary castling
restrictions for the seventh and eighth plies.
Cunningham (1889) incorrectly found games and
positions after four plies. C. Flye St. Marie
was the first to find the correct number of positions after four plies:
.
Dawson (1946) gives the source as Intermediare des Mathematiques (1895), but
K. Fabel writes that Flye St. Marie corrected the number
(that he found in 1895) to
in 1903. The history of the determination of the chess
sequences is discussed in Schwarzkopf (1994).
The analysis of chess is extremely complicated due to the many possible options at each move. Steinhaus (1999, pp. 11-14), as well as many entire books, consider clever end-game positions which may be analyzed completely.
Under the FIDE Laws of Chess effective Jan. 1, 2023, a game from the standard initial position has at most 17697 plies. This bound is sharp; in every maximum-length game, all 16 pawns make six one-rank moves and promote (Yim 2026).
Two problems in recreational mathematics ask the questions
1. How many pieces of a given type can be placed on a chessboard without any two attacking?
2. What is the smallest number of pieces needed to occupy or attack every square?
The answers are given for the usual chessboard in the following
table (Madachy 1979).
| problem | max. | min. |
| bishops problem | 14 | 8 |
| kings problem | 16 | 9 |
| knights problem | 32 | 12 |
| queens problem | 8 | 5 |
| rooks problem | 8 | 8 |
