NULP

(Number of Unique Legal Positions in chess endgames)

Results

Number of endgames

Standard Chess can have 29,045,304 different endgames, corresponding to 58,084,310 endgame + side to move combinations (ESMs). Please see the Number of Endgames page for details.

NULP in Chess

The number of unique legal positions (as defined in Method) in Chess endgames with 8 or fewer pieces is 38,603,956,906,065,185. The following table and chart show the NULP for each number of pieces.

PiecesPositions
2 462 (*)
3 368,079 (*)
4 125,246,598 (*)
5 25,912,594,054 (*)
6 3,787,154,440,416 (*)
7 423,836,835,667,331 (*)
838,176,306,877,748,245 (*)
Chess NULP

The numbers link to text files with NULP for each endgame. The asterisks link to text files with NULP for each ESM.

Largest endgames

PiecesPawnlessWith pawns
EndgameSizeEndgameSize
2kk462
3knk53,806kpk165,676
4kbnk3,067,466knpk9,699,457
5kbnkn175,863,026knpkn556,739,460
6krbnkn9,488,822,935kbnpkn30,803,735,265
7krbnkbn512,840,231,278kbnpkbn1,670,865,014,596
8kqrbnkbn25,192,079,591,272krbnpkbn87,076,702,767,652

Castling

Endgames with castling rights are extremely rare, so they are typically ignored in endgame solving. The next table shows the number of Chess positions with castling rights with up to 8 pieces. The numbers in parentheses and the chart show proportion of such positions.

PiecesPositions with
castling rights
2 0 (0.000%)
3 211 (0.057%)
4 113,158 (0.090%)
5 29,955,209 (0.116%)
6 5,216,780,406 (0.138%)
7 672,112,496,048 (0.159%)
868,300,985,290,716 (0.179%)
Proportion of Chess positions with castling rights

As expected, very few endgame positions have castling rights: about 0.1% of all positions with 4 or 5 pieces. The proportion is slowly increasing with extra pieces, probably reaching 0.2% with 10 pieces.

Clearly space saving consideration alone can't justify the exclusion of these positions from solving. The extra effort required for implementing the indexing of these positions is likely the main reason why these positions are usually omitted. Since loss of the castling right is irreversible, it's possible to construct a separate database for just positions with castling rights, which can be used alongside with existing endgame database.

En passant capture

How many chess positions have en passant capture rights? Here are the numbers for up to 8 pieces.

PiecesPositions with
en-passant capture rights
2 0 (0.000%)
3 0 (0.000%)
4 23,017 (0.018%)
5 11,960,101 (0.046%)
6 3,066,498,815 (0.081%)
7 517,042,047,128 (0.122%)
864,468,257,617,466 (0.169%)

En passant capture and castling

How many positions have both en passant capture and castling rights? How many have just castling or just en passant? How many have none? Here are the numbers for up to 8 pieces ('C' = castling rigths, 'E' = en passant capture rights). Numbers link to text files with NULP for each endgame, asterisks link to text files with NULP for each ESM.

PiecesPositions
CEE&C
2 462 (*) 0 (*) 0 (*) 0 (*)
3 367,868 (*) 211 (*) 0 (*) 0 (*)
4 125,110,423 (*) 113,158 (*) 23,017 (*) 0 (*)
5 25,870,681,552 (*) 29,952,401 (*) 11,957,293 (*) 2,808 (*)
6 3,778,872,612,577 (*) 5,215,329,024 (*) 3,065,047,433 (*) 1,451,382 (*)
7 422,648,050,983,625 (*) 671,742,636,578 (*) 516,672,187,658 (*) 369,859,470 (*)
838,043,599,567,172,213 (*)68,239,052,958,566 (*)64,406,325,285,316 (*)61,932,332,150 (*)

The next table shows the proportion of positions with/without en passant and castling rights among all positions with the same number of pieces. The chart compares columns 'C' and 'E'.

PiecesPositions, %
CEE&C
2100.0000.0000.0000.000
3 99.9430.0570.0000.000
4 99.8910.0900.0180.000
5 99.8380.1160.0460.000
6 99.7810.1380.0810.000
7 99.7200.1580.1220.000
8 99.6520.1790.1690.000
Proportion of Chess positions with castling rights compared with proportion of positions with en passant capture rights

Positions with castling rights are more abundant than those with en passant, when the number of pieces is 8 or less. However it's safe to say that from 9 pieces the relation reverses.

Chess960

Chess960 (Fischer Random Chess) is a popular chess variant featuring additional starting positions. From endgame solving point of view its only difference from Chess is that many more positions can potentially have castling rights:

PiecesChess960 positions
with castling rights
Chess960/Chess
2 0 (0.000%)
3 4,420 (1.187%)20.948
4 2,385,912 (1.871%)21.085
5 635,808,642 (2.398%)21.225
6 111,477,502,856 (2.863%)21.369
7 14,460,843,451,896 (3.304%)21.516
81,479,698,416,937,946 (3.738%)21.664
Proportion of positions with castling rights (Chess and Chess960)Chess960/Chess ratio for the number of positions with castling rights

Chess960 has more than 20 times more positions with castling rights than Chess. With 7 pieces already over 3% of Chess960 positions have castling rights, which is insane compared to Chess. Here space and time saving can be an argument for omitting such positions, however this way we'll miss more than 3% of beauty and complexity of Chess960 endgames, which I see as a big loss. The Chess960/Chess ratio of the number of positions with castling rights is remarkably stable around 21-22, and is slowly increasing with extra pieces, almost perfectly linearly.

Using the castling data above it's easy to find the number of Chess960 positions:

PiecesChess960 positions
2 462
3 372,288
4 127,519,352
5 26,518,447,487
6 3,893,415,162,866
7 437,625,566,623,179
839,587,704,309,395,475

Chess960 is a superset of Chess: every Chess position exists in Chess960, but not the vice versa - some Chess960 positions are not found in Chess. The following table/figure shows the proportion of Chess960 endgame positions overlapping with Chess.

PiecesAmong Chess960 positions
% in Chess% not in Chess
2100.0000.000
3 98.8691.131
4 98.2181.782
5 97.7152.285
6 97.2712.729
7 96.8493.151
8 96.4353.565
Overlap between Chess and Chess960

© 2013–2014 Kirill Kryukov
Available under the CC BY 3.0 License