INAIO Guide Stage 1 7Combinatorics and Discrete Reasoning
7.4 Parity and invariants
Track a quantity that every move preserves or predictably changes to prove that a target is impossible.
Some puzzles allow many moves, making it hard to list every reachable state. Instead, look for a feature that cannot change. If the starting state has one value of that feature and the target has another, no sequence of permitted moves can connect them. This is an invariant argument. Parity—whether an integer is even or odd—is often the simplest feature to test.
This is intermediate discrete reasoning. MIT's state-machine notes develop the invariant method, and its modular-arithmetic notes explain parity as a remainder. You only need the even/odd rules to begin.
A basic idea: what survives every move?
Colour a board like a chessboard. Every horizontal or vertical domino covers one dark and one light square, regardless of where it is placed. Remove two opposite corners. They have the same colour, so the board now has squares of that colour and of the other. Seven dominoes would have to cover seven of each. That cannot happen, even if you try many clever placements.
A quick tour of the method
An integer's parity is its remainder after division by : even has remainder , odd has remainder . Adding an even number preserves parity; adding an odd number changes it. More generally, an invariant is a quantity or property that every allowed move preserves. To use one:
- Define the feature precisely for any state.
- Check every type of legal move, not just one example, preserves it.
- Compare the feature in the starting state and the proposed target.
Some features alternate rather than stay fixed. A single horizontal or vertical grid step changes by or , so the parity of flips after every step. Knowing the number of steps then determines which colour of a checkerboard the walker can reach. This is still a useful state rule, but call it an alternating property rather than a preserved invariant.
An invariant can prove impossibility when the values disagree. Matching values do not prove that a path or tiling exists; other obstacles may remain.
Application 1: missing corners
Can seven dominoes tile a checkerboard after two opposite corners are removed?
- The original board has eight squares of each colour. Opposite corners on this even-sized board have the same colour.
- Removing them leaves of that colour and of the other.
- Each domino always covers one square of each colour. Seven dominoes would cover and , so the tiling is impossible.
Application 2: an exact number of grid moves
A walker starts at and makes exactly moves, each one unit north, south, east, or west. Can it finish at ?
- At the start, is even. Each move flips its parity.
- After an odd number of moves, must be odd.
- At , is even. Therefore no route of exactly moves can end there. The point is reachable in four moves, but the specified move count is not.
Resources
| Source | Title | Why read it |
|---|---|---|
| MIT OpenCourseWare | Lecture 4: State Machines | Study how invariants restrict reachable states. |
| MIT OpenCourseWare | Lecture 9: Modular Arithmetic | Review even and odd values as remainders modulo two. |
Finished this module? Mark it done.
Comments
Stuck on something, spotted a mistake, or found a resource that helped you? Tell us below.
Loading comments