Peg solitaire — sold as Brainvita in India, Hi-Q in the US — is a one-player board game played on a cross-shaped grid of holes. The board starts full of pegs except for the center hole. You slide a peg over a neighbor into an empty hole; the jumped peg is removed. The classic goal: empty the board down to exactly one peg, standing on the center.
The puzzle looks deceptively easy. You can jump for hours and end up with two or three pegs stuck in the corners. The frustrating question is: was the goal you were aiming for ever reachable, or did you doom yourself from the first move?
This is where mathematics delivers a decisive answer — not by exhaustive search, but by a coloring argument. Paint the board with three colors following a simple repeating pattern. Assign each color a number. A single quantity built from those numbers never changes no matter which jump you make. If start and target disagree on that number, no sequence of moves — not even the cleverest one imaginable — can get you there.
This kind of quantity is called an invariant. Conway and his co-authors formalized it as the pagoda function in their landmark book Winning Ways for Your Mathematical Plays (1982). The invariant technique is solved: given any starting position and any target, you can compute in seconds whether the target is reachable in principle (necessary but not always sufficient). The peg solitaire problem itself, in its general form, is PSPACE-complete (Demaine et al., 2021), but the invariant gives a cheap necessary filter before any deeper search.
Comments
Loading comments...