LibraryReference articles

Something that never changes, and odd versus even

Reference article

A row of seven lamps, all off. A move flips exactly two lamps, any two you like. Can all seven end up on? Count the lamps that are on. Each move changes that count by two, or by zero, or by minus two, so it is always even, and seven is odd. No sequence of moves works, and no sequence was ever tried. The even count is the thing that does not change.

Proving something cannot be done

Trying everything is one way to show a task is impossible, and it only works when the number of tries is small. There is a cleaner way. Find a quantity that the rules never let you change, and show the target would need it to change.

A quantity like that is called an invariant: it stays the same, whatever allowed move is made. If the start has one value and the goal needs another, the goal is unreachable, and the argument covers every sequence of moves at once, including ones nobody would think of.

The seven lamps

Seven lamps start off, and a move flips two lamps of your choice. Count the lamps that are on. A move that flips two lamps that were off adds two to the count. Flipping one on and one off leaves the count alone. Flipping two that were on takes two away. So the count only ever changes by plus two, zero or minus two, and starts at zero. It is therefore always even. Seven is odd, so all seven lamps on is impossible.

Change one detail and the answer flips. With six lamps the target of six is even, the invariant allows it, and three moves of flipping disjoint pairs do it. An invariant says what cannot happen. It never promises that what is left can.

Why parity is the first thing to try

Odd or even is the smallest nontrivial invariant. Many rules move things in pairs, or swap two items, or add and remove in twos, and each of those preserves evenness or flips it in a way you can track. The question to ask is: does this move change my count by an even number, always?

Swaps are a good case. Exchanging two items in a list changes the order by one swap, so the number of swaps needed to reach a given arrangement is always odd or always even for that arrangement, never both. That is why some arrangements of a sliding tray are unreachable however long you shuffle.

The chessboard with two corners removed

A classic. Cover a chessboard with dominoes, each covering two touching squares. With all sixty-four squares there are plenty of ways. Now remove two opposite corners and ask for a perfect covering of the remaining sixty-two. Every domino covers one dark and one light square, since touching squares differ in colour. Opposite corners share a colour, so the board is left with thirty light squares and thirty-two dark ones, or the other way round. Thirty-one dominoes would need thirty-one of each. The difference between the colours is the invariant, and it rules the covering out without a single attempt.

Using the idea to build rather than to forbid

The same thinking helps when you are trying to design a strategy. If you can make some count end up even or odd whatever the other side chooses, you have taken control of the final answer. The things to identify are which part of the situation you can set, which part you cannot, and whether a total over both is fixed by your choice alone.

Where this breaks

An invariant proves impossibility only when you have found the right one. Failing to find one proves nothing. And an invariant has to survive every move, including unusual ones, so one exception in the rules quietly destroys the argument. Check the rules again after finding a promising count.

How we know this landed

Two checks. Five lamps, a move flips two, the lamps start off: the count of lamps on stays even, so all five cannot be on, but four can. And on a board where touching squares differ in colour, a domino always covers one of each colour, which is the fact the chessboard argument depends on. If either feels shaky, redo the lamp count move by move.

In short

To show a goal cannot be reached, find a property that every allowed move preserves and that the goal violates. Odd or even is the first candidate to try. To use the same idea constructively, pick the property you control and let the other side's choice settle the rest.

Related

Writing out everything that can happen

Two coins give four results, not three, and heads then tails is not the same as tails then heads. Counting done by hand, on paper, before a single formula turns up.

More on these topics

Topics

Also in the library