Why Invariants Can Reveal What Is Impossible

Introduction

Some problems seem to invite endless trial and error: rearrange objects, follow a sequence of moves, or try to reach a particular arrangement. An invariant can cut through that search. It is a feature that stays unchanged under every permitted move. If the starting situation and the desired result have different values for that feature, the result is impossible. This simple idea is useful in puzzles, mathematics, and scientific reasoning.

What Is an Invariant?

An invariant is a property or quantity that remains the same while a system changes in specified ways. The system may be a board, a number, a shape, or a collection of objects. The key phrase is “in specified ways”: an invariant is not necessarily constant under every conceivable change, only under the operations allowed in the problem.

Imagine a puzzle in which tiles slide into an empty space. The tiles change position after each move, but their labels do not change. The total set of labels is therefore invariant. Other features, such as which tile is in the upper-left corner, may change. A useful invariant is one that remains fixed and helps distinguish arrangements that can be reached from those that cannot.

Invariants are often numerical, such as whether a number is odd or even. They can also be structural or descriptive: the number of pieces of a certain kind, the color of a square, the parity of a permutation, or the total area of a shape. “Parity” means whether an integer is even or odd.

How an Invariant Reveals Impossibility

To show that a goal cannot be reached, compare the invariant at the beginning with its value in the proposed final state. If every permitted move preserves the invariant, then its value cannot change along any sequence of moves. A target with a different value is outside the set of reachable states.

This reasoning has three basic parts:

1. Define the possible states and the allowed moves.
2. Find a feature that every allowed move preserves.
3. Show that the starting state and target state have different values of that feature.

The conclusion is a proof of impossibility, not merely evidence from failed attempts. Trying many sequences can suggest that a puzzle is unsolvable, but it cannot rule out a sequence that has not been tried. An invariant can rule out every sequence at once, because it applies to each move in every possible sequence.

This method usually proves that a target cannot be reached; it does not automatically prove that every target with a matching invariant can be reached. Two arrangements may share an invariant and still be disconnected for some other reason. Invariants are powerful filters, but a matching value is not always a complete solution.

A Checkerboard and a Missing Corner

A classic illustration uses a rectangular board made of squares, colored like a checkerboard. Suppose two opposite corners are removed, and the question is whether the remaining board can be covered exactly by dominoes. Each domino covers two neighboring squares.

Color the board alternately black and white. Every domino placed on neighboring squares covers one black square and one white square. Therefore, any complete domino covering must pair the squares into equal numbers of each color. That balance is the relevant invariant: each piece contributes one square of each color.

On a board with an even number of rows and columns, opposite corners have the same color. Removing those corners removes two squares of that one color. The remaining board consequently has unequal numbers of black and white squares. Since every domino covers one of each, no arrangement of dominoes can cover the board completely.

The argument does not depend on how cleverly the dominoes are arranged. It does not need to examine individual placements, because the color balance is fixed by the shape of every piece. Notice, too, that the proof depends on the board dimensions and which squares are removed. The same color-count argument must be checked afresh for a different board.

Parity in Number Problems

Parity is one of the simplest and most frequently useful invariants. Adding an even number to an integer preserves its parity: even plus even remains even, and odd plus even remains odd. Adding an odd number flips parity. Such facts let us rule out numerical targets without calculating every possible sequence.

For example, suppose a number starts at 10, and the only permitted operation is to add 4 or subtract 4. Every result is even, because each move changes the value by an even amount. The number 17 is odd, so it cannot be reached. The exact number of moves does not matter.

In some problems, the invariant is not the number itself but its remainder after division by another number. If every permitted change is a multiple of 5, for instance, the remainder upon division by 5 stays fixed. A starting value that leaves remainder 2 can never become a value that leaves remainder 4 through those operations alone.

Modular arithmetic is the formal language for this kind of reasoning. “Modulo 2” tracks parity; “modulo 5” tracks remainders after division by 5. The language may sound technical, but the idea is ordinary: group numbers by a repeating feature and check whether the allowed moves can take a value from one group to another.

Invariants in Rearrangement Puzzles

Sliding-tile puzzles provide another useful setting. A move swaps the empty space with one adjacent tile. The order of tiles changes, and it is tempting to assume that enough moves can produce any arrangement. In fact, constraints involving the parity of the tile order and the position of the empty space can separate reachable arrangements from unreachable ones.

To understand the idea, imagine listing the numbered tiles in a fixed reading order and counting inversions. An inversion is a pair that appears in the opposite order from their numerical order. The parity of this count changes in a controlled way when a tile is moved. Depending on the board’s dimensions, the empty space’s row position must also be considered. Together these features impose a reachability constraint.

The precise test depends on the puzzle’s layout, so it should not be transferred blindly to every sliding puzzle. The general lesson is broader: when objects are rearranged by restricted swaps, some measure of the arrangement may change only in specific steps. Tracking that measure can show that two configurations belong to different classes.

Related reasoning appears when sorting objects by swaps. A swap can alter the parity of a permutation, meaning whether the arrangement can be reached from another by an even or odd number of exchanges. If the permitted operations preserve a particular parity condition, a target with the wrong condition is excluded.

Conserved Quantities and Invariants

In physics, the word “conserved” is often used for quantities that stay constant in a system under suitable conditions. Examples include total energy in an idealized isolated system and total electric charge in processes described by established physical laws. A conserved quantity is a kind of invariant, although the terms are used in different contexts and with different technical meanings.

The conditions matter. Energy can move between forms, and real systems may exchange energy with their surroundings. When people say that total energy is conserved, they are referring to an appropriately defined system and accounting for relevant transfers. The invariant is not necessarily the visible form of the energy or the amount located in one part of the system.

Mathematical puzzles often use invariants without invoking physical laws. A checkerboard color count is not a conservation law of nature; it is a property preserved by a particular set of moves or pieces. In both cases, the reasoning pattern is similar: specify the system, identify what changes are allowed, and determine what those changes leave untouched.

Finding a Useful Invariant

There is no single recipe that finds an invariant for every problem, but a few questions can guide the search. First, ask what each legal move changes and what it leaves alone. If a move changes a quantity by a fixed amount, consider tracking that quantity’s parity or remainder rather than its exact value.

Next, look for categories that the moves cannot cross. A move might always exchange one item of each color, preserve the number of pieces of a type, or change an arrangement’s parity in a predictable way. A useful invariant often emerges by simplifying the problem: ignore exact positions and track only a feature such as color, count, parity, or total.

It also helps to test a candidate against every permitted move, not just a few examples. A property that survives most moves but fails under one legal move is not an invariant for the problem. Likewise, a property may be invariant only under a restricted set of operations, so the rules must be stated clearly.

Finally, compare the invariant in the initial and target states. If they match, the test has not established reachability; another argument may be needed. If they differ and the property is genuinely preserved, the impossibility conclusion follows.

Common Limits and Mistakes

A frequent mistake is confusing “I cannot find a route” with “no route exists.” Invariants address this gap by proving a restriction that applies to all legal routes. But the proof is only as sound as its assumptions: if an overlooked move changes the proposed invariant, the conclusion may fail.

Another mistake is treating an invariant as a complete description of a state. It may divide all states into broad groups, while several distinct arrangements remain within each group. Matching invariant values means only that this particular test does not rule out the target.

It is also important to distinguish an invariant from a quantity that merely changes slowly or usually stays constant. In a mathematical proof, preservation must hold for every allowed step. In a scientific model, a quantity may be conserved only under stated conditions or approximated as constant for a useful range. Context determines how strong the conclusion can be.

Why the Method Matters Beyond Puzzles

Invariant reasoning is valuable because it replaces an enormous search with a compact explanation. In mathematics, it helps establish that an equation, arrangement, or process cannot have a desired outcome. In computer science, related ideas help analyze state changes and verify that a program maintains required properties. In science, tracking conserved quantities helps organize models of changing systems.

The method also teaches a wider habit of thought: before asking how to reach a goal, ask whether the permitted actions can possibly cross the boundary between the current state and that goal. A carefully chosen invariant can reveal such a boundary even when the number of possible steps is unlimited.

Conclusion

An invariant is a feature that remains unchanged under the permitted moves of a problem. By comparing its value in the starting state and the desired state, we can sometimes prove that no sequence of moves can connect them. Parity, color balance, remainders, and arrangement properties are common examples. An invariant does not solve every problem, but it can turn an open-ended search into a clear, rigorous test of what is possible.