Jump to content

Chess/Board Configurations

From Wikiversity
Attribution: this resource was created by Harold Foppele.
Type classification: this resource is a learning project.
Subject classification: this is a mathematics resource.

Introduction

[edit | edit source]

This page shows how complex the game of chess is in terms of possible positions on a chessboard.
Consider a standard chessboard with 64 squares. Each square can be in one of 13 possible states: one of six white pieces (pawn, rook, knight, bishop, king, or queen), one of six black pieces (pawn, rook, knight, bishop, king, or queen), or empty.

History

[edit | edit source]
10 MB
Rear

In 1975, when personal computers were just beginning to emerge, storage capacity was both small and extremely expensive. One megabyte of storage cost around US$2,500. Adjusted for 50 years of inflation, that corresponds to roughly US$6,000 per megabyte today. A 10-megabyte hard-disk unit could weigh around 200 kilograms.
My friend and I were discussing this and started a mind game. When you calculate how much storage would be required to hold all possible positions of a chessboard, you end up with astronomically large numbers — far beyond anything that could have been imagined with the hardware of that era.
The following shows the evolution from those massive, costly early storage devices to the capacities we enjoy today. Have fun!

Step 1: Unconstrained case

[edit | edit source]
a8 black rook
b8 black knight
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
g8 black knight
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
e7 black pawn
f7 black pawn
g7 black pawn
h7 black pawn
a6 white pawn
b6 white pawn
c6 white pawn
d6 white pawn
e6 white pawn
f6 white pawn
g6 white pawn
h6 white pawn
a5 black knight
b5 black knight
c5 black knight
d5 black knight
e5 black knight
f5 black knight
g5 black knight
h5 black knight
a4 white bishop
b4 white bishop
c4 white bishop
d4 white bishop
e4 white bishop
f4 white bishop
g4 white bishop
h4 white bishop
a3 white queen
b3 white queen
c3 white queen
d3 white queen
e3 white queen
f3 white queen
g3 white queen
h3 white queen
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
e2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
d1 white queen
e1 white king
f1 white bishop
g1 white knight
h1 white rook

If each square can independently take any of the 13 possibilities, the total number of possible board configurations is:






Step 2: Constrained case (maximum 32 pieces)

[edit | edit source]
a8 black rook
b8 black knight
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
g8 black knight
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
e7 black pawn
f7 black pawn
g7 black pawn
h7 black pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
e2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
d1 white queen
e1 white king
f1 white bishop
g1 white knight
h1 white rook

Suppose the board may contain at most 32 pieces. Let be the number of non-empty squares (pieces) on the board.

For a fixed , the number of configurations is:

This counts the ways to choose which squares contain pieces, multiplied by the 12 possibilities for each piece (excluding empty).

Step 3: Sum over all allowed numbers of pieces (expanded)

[edit | edit source]

Since can range from 0 (empty board) to 32 (maximum pieces), the total number of allowed configurations is:

Here:

  • The first term represents the empty board.
  • The second term represents boards with a single piece.
  • The third term represents boards with two pieces.
  • \(\dots\)
  • The last term represents boards with 32 pieces, and dominates the total sum.

Step 4: Maximum pieces term ()

[edit | edit source]

The term corresponding to the maximum allowed number of pieces is:

Using rough approximations:

Multiplying gives the largest term:

Step 5: Why the term dominates

[edit | edit source]

For sums of the form:

the largest term occurs at because both the binomial coefficient and increase with . Therefore, the term contributes most of the total.

Hence, the total number of configurations with at most 32 pieces is roughly:

This is much smaller than the unconstrained total:

but still astronomically large.

This does include impossible positions (as for 2 Kings positioned at adjacent squares) but it gives a rough idea of the magnitude.

But just for calculation:

if the total number of pieces (excluding kings) is ≤ 30 (so total ≤ 32 including the kings):

This gives an approximate number of boards with at most 32 pieces and kings not adjacent.

Visualize

[edit | edit source]
"Seawise Giant" - Singapore, 1990

The vessel on the right has a capacity of over 564,763 DWT (Tons), build in 1979, length 458,45 metera witdh 68,8 meters. One of the largest oil tankers ever build.
Now what has that to do with our calculations. We found a number

but how can we imagine what that actually means? I will take you to a thought expiriment. Think of this tanker in your mind. Try to see the lenght 458 meters, width 69 meters, draft (depth in the water) 25 meters. So keep that picture in mind. Now we are going to fill this tanker with data in the form of SSD each capable of 4 Terrabyte storage. So we first have to put all possible positions into bytes. We need 32 bytes for 1 position. so we multiply our findings times 32 now we have Bytes. Now we put those bytes onto 4 terrabyte ssd so we divide the number of bytes we found by 4 terrabyte. Result is: SSD's. So we are getting smaller numbers. For simple calculations we assume the SSD weights 10 gram. Lets convert it to tons (1000 kilogram).
Now we get an even smaller number. But still not very visible. So let us put these SSD's into tankers, as we found out, 500,000 ton each. Thus divide the number of tons by 500,000/tanker.
Are you still with us?

Ok that brings down the number again. Now we have to put the tankers in harbors of lets say 1,000 tankers/harbor.

Yet again a smaller number. But lets see how many Earth (planets) we need to store all those harbors:

Ahh you get dizzy. Dont worry it gets even better.

Will this fit in our known Universe?

So the simple answer to the question Will it fit in the Universe? is yes.

But this is just the beginning.If you fill the Earth with data like Bits = electrons then ..........

And that, finaly, is an understandable number. Now you have 3 Planets to deal with.

One step further

[edit | edit source]

In the situation described, you suddenly have 3.48 Planets on your hands. Pretty, but more than a handfull. What if we let Quantum Computers handle that?
The storage of all these chess board configurations could in principle be done using qubits in a quantum memory or quantum computing system, though current technology is far from capable of handling such scales (quantum memories are still experimental and limited to small numbers of qubits with short coherence times). However, let's extend the thought experiment from the "Visualize" section to see what this might mean, staying true to the spirit of illustrating magnitudes.

Classical Storage Using Qubits

[edit | edit source]

If we're talking about storing the explicit list of all ~8.9 × 10^52 configurations as classical data (e.g., a massive database where each configuration is encoded in 32 bytes), qubits wouldn't provide a magical reduction in the required physical resources. According to Holevo's theorem in quantum information theory, the maximum amount of classical information you can reliably extract from N qubits is N bits, no more than what you'd get from N classical bits. In other words: - Each qubit can effectively store 1 bit of classical data when used for this purpose.

- The total data size remains ~2.848 × 10^54 bytes (~2.278 × 10^55 bits), as calculated in the page. - Using the page's assumption of Earth's electrons (6.55 × 10^54) as potential qubits (e.g., via electron spins), the bits-per-Earth would be the same as in the classical case: ~6.55 × 10^54 bits.

- Thus, the number of Earths needed would still be ~3.48, just like the electron-as-bit scenario.

In practice, quantum storage for classical data might even require "more" physical resources due to error correction, cooling, and isolation needs to combat decoherence, but in this idealized thought experiment, it's equivalent to the classical bit calculation.

Quantum Superposition Representation

[edit | edit source]

Now, for a more mind-bending twist: if we reinterpret "storage" as representing the "entire set" of configurations in a quantum superposition (rather than an explicit classical list), qubits offer a dramatic advantage. A quantum system can hold a superposition of states, where N qubits span a space of up to 2^N possible basis states.

- The number of configurations .

The minimum qubits needed to span a space at least as large as (for a uniform superposition like ) is qubits (calculation: , ).

Encoding each configuration would require mapping them to indices in this -qubit register (plus some classical code to decode an index back to a board layout, which is negligible in size).

In this setup, a single small quantum chip (far smaller than one SSD, let alone a tanker or Earth), could "hold" the superposition of all configurations. This isn't traditional storage, you couldn't easily list them all out or retrieve a specific one without quantum algorithms (e.g., Grover's search) but it's useful for quantum computations over the space, like searching for optimal moves in hypothetical quantum chess solvers.

This superposition approach fits everything into a device you could hold in your hand, making the tankers, harbors, Earths, and galaxies unnecessary. It highlights how quantum mechanics can collapse enormous combinatorial spaces into tiny physical systems.

In summary, yes, qubits could handle the storage, either mirroring the classical calculation (for an explicit list) or vastly outperforming it via superposition (for a representational overlay). The page's thought experiment is a fun way to grasp the scale, and qubits add an extra layer of quantum weirdness to it!

Thus, in the end, you've got the whole worlds in your hand.

I hope you enjoyed.