Get AI summaries of any video or article — Sign up free
The impossible chessboard puzzle thumbnail

The impossible chessboard puzzle

3Blue1Brown·
6 min read

Based on 3Blue1Brown's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Model each coin configuration as a vertex of an n-dimensional hypercube; flipping one coin moves along an edge to a neighboring vertex.

Briefing

A prisoner-style chessboard puzzle turns into a sharp impossibility result: if the board size (the number of squares) is not a power of two, no strategy can guarantee success against an adversarial warden. The setup forces prisoner 2 to deduce the key’s location after seeing only the coin pattern that remains after prisoner 1 flips exactly one coin. Because the warden can choose the coin layout and key position adversarially, the only way to win is to ensure that from every starting coin configuration, a single coin flip can move the observed pattern into the “region” corresponding to any of the possible key locations.

To make that requirement concrete, the puzzle is reframed as geometry on a hypercube. With two squares and two coins, the four coin states become the corners of a unit square; flipping one coin moves along an edge. The winning condition becomes a coloring problem: assign each corner a color representing which key location prisoner 2 should infer, and require that from any corner, the neighboring corners include the full set of colors. The same translation scales up: with three squares, three coins, and three key locations, the eight coin states become the corners of a cube in 3D, and each coin flip corresponds to moving to an adjacent vertex.

Counting strategies becomes a combinatorial “haystack” exercise—each vertex can be colored in three ways, giving 3^8 possible colorings for the 3-square case (and, by analogy, 2^64–style growth for the original 64-square puzzle). Some colorings work for certain starting corners but fail for others. A simple “mod 3 sum” strategy illustrates the failure mode: even if it lets you reach all three colors from some starting states, it leaves at least one corner where two neighboring vertices share the same color, preventing access to one key location. An adversarial warden can exploit that blind spot by choosing the key to lie under the unreachable color.

That observation leads to a general counting argument that blocks success in most dimensions. Suppose a hypercube coloring exists with the property that every vertex has neighbors of all colors (one for each possible key location). Then, by counting how many “red-adjacent” edges exist in two different ways—once by summing over vertices and once by summing over red vertices—one derives a divisibility constraint. In n dimensions, the total number of vertices is 2^n, each vertex has n neighbors, and the required neighbor-color balance forces the number of red vertices to be exactly 2^n / n. Since the left-hand side is a power of two, n must itself be a power of two for the arithmetic to work out. If n is not a power of two, the needed equal partitioning of vertices among colors becomes impossible, so no strategy can guarantee the puzzle’s goal.

The result explains why “making it easier” by removing squares or changing the board size can actually make the task hopeless: the impossibility proof doesn’t just rule out clever tricks—it rules out all strategies when the number of squares isn’t a power of two. The remaining power-of-two cases are not automatically solvable, but they are no longer excluded by this symmetry-and-counting obstruction. The discussion then points to an especially symmetric construction for the 4-dimensional case, where the hypercube can be projected into 3D for visualization, and where each vertex’s neighbors can be colored to match all four key locations—an outcome that the counting argument says is at least not forbidden when the dimension is a power of two.

Cornell Notes

The chessboard puzzle can be translated into a hypercube coloring problem. Each coin configuration is a vertex of an n-dimensional cube, and flipping one coin moves to a neighboring vertex. A winning strategy corresponds to coloring vertices by key locations so that from any vertex, the set of neighboring colors includes every possible key location. For n not equal to a power of two, a counting argument shows such a coloring cannot exist: double-counting “red-neighbor” incidences forces the number of vertices per color to be 2^n/n, which can only be an integer when n is a power of two. Therefore, no strategy can guarantee success for board sizes whose square-count isn’t a power of two, even against the most carefully planned adversarial warden.

How does flipping exactly one coin become a statement about moving on a hypercube?

Represent each coin state as a bitstring. With n coins, there are 2^n possible states, one per vertex of an n-dimensional hypercube. Flipping one coin toggles exactly one bit, which moves the state along one edge to a neighboring vertex. The prisoner’s single allowed flip means prisoner 2 will see a vertex adjacent to the starting vertex, so the strategy must work via adjacency relationships on the cube.

Why can a strategy be viewed as coloring vertices with key-location labels?

Each coin configuration must map to what prisoner 2 should infer about the key’s square. If there are n possible key locations, assign each vertex one of n colors corresponding to those locations. The “one flip” rule requires that from any starting vertex, the neighboring vertices collectively cover all colors—so prisoner 2 can always interpret the post-flip configuration as any desired key location.

What goes wrong with a “mod 3 sum” style strategy in the 3-square case?

In the 3D cube model (8 vertices), some strategies based on a modular sum can reach all three colors from some starting corners but not from others. The transcript’s example shows a starting configuration where flipping certain coins only moves to two colors, leaving the third color unreachable. That creates a corner with two neighbors of the same color, letting an adversarial warden choose the key location corresponding to the missing color.

What is the core counting contradiction that rules out solutions when n is not a power of two?

Assume a coloring exists where each vertex’s neighbors include exactly one vertex of each color. Pick one color (say red) and count the number of edges from vertices to red neighbors in two ways. Summing over all vertices gives 2^n (each vertex contributes exactly one red neighbor). Summing over red vertices gives n times the number of red vertices (each red vertex has n neighbors). Equating these forces the number of red vertices to be 2^n/n, so n must divide 2^n. Since 2^n is a power of two, n must itself be a power of two.

Does the power-of-two condition guarantee a solution?

No. The argument only shows that when n is not a power of two, success is impossible. When n is a power of two, the counting obstruction disappears, so a solution is not ruled out; it may still fail for other reasons. The transcript later points to explicit constructions in the 4-dimensional case as evidence that power-of-two dimensions can admit highly symmetric solutions.

Review Questions

  1. In the hypercube model, what exact property must the vertex coloring satisfy so that prisoner 2 can always deduce any key location after one flip?
  2. Reproduce the double-counting argument for one color (e.g., red): what two quantities are counted, and why must they match?
  3. Why does the requirement that 2^n/n be an integer force n to be a power of two?

Key Points

  1. 1

    Model each coin configuration as a vertex of an n-dimensional hypercube; flipping one coin moves along an edge to a neighboring vertex.

  2. 2

    A guaranteed-winning strategy corresponds to coloring vertices by key locations so that every vertex’s neighbors collectively cover all colors.

  3. 3

    Not every coloring works: some strategies succeed from certain starting corners but fail from others, leaving at least one key location unreachable after one flip.

  4. 4

    A double-counting argument on “red-neighbor” edges forces the number of vertices per color to equal 2^n/n.

  5. 5

    Because 2^n is a power of two, the divisibility condition implies n must be a power of two; otherwise, no strategy can guarantee success.

  6. 6

    Changing the puzzle by removing squares or altering the board size can make the task impossible by breaking the power-of-two condition.

  7. 7

    Power-of-two cases are not automatically solvable, but they are the only sizes not eliminated by this symmetry-and-counting obstruction.

Highlights

The puzzle’s success condition becomes a hypercube coloring rule: from every vertex, one-step neighbors must realize every key-location label.
A simple modular-sum strategy fails because some starting corner has neighbors of only two colors, letting the warden pick the missing key location.
Double-counting neighbor-color incidences forces n to divide 2^n, which can only happen when n is a power of two.
The impossibility result explains why “simplifying” the board by changing its size can actually make the challenge hopeless.
A 4-dimensional construction is singled out as a particularly symmetric case where the required neighbor-color coverage can be achieved.

Topics

  • Hypercube Coloring
  • One-Flip Deduction
  • Impossibility Proof
  • Combinatorial Counting
  • Error Correction Connection

Mentioned