Method line M12 · When and why do we use it?

Parity

In the Chinese book: 奇偶分析

Ask only “odd or even?” If no move changes it, some goals are out of reach.

📖 §3.1 of 《解题方法与策略》

One idea, one pictureEach move, choose exactly 4 cups and flip them over. Try to get all 7 cups mouth down. What do you notice about the number facing down?

Loading figure…

In one sentence

Sort the integers into just two kinds: odd and even. Throw away every other piece of information.

The pay-off: many complicated operations change nothing at all when seen through these “two-color glasses”. If some quantity's parity never changes, and the goal has a different parity from the start, then the goal can never be reached. You do not have to try every possible way.

The rule you will use most: when you add up a list of integers, the parity of the sum depends only on how many odd numbers there are. An odd number of odd numbers gives an odd sum; an even number of odd numbers gives an even sum.

Predict first

Without working it out: is odd or even?

Choose an answer first; then you can see the result.

Stop 1 · Parity arguments (Vol. 6)

Put a or a in front of each of . Can you make the result equal ? Try a few times yourself first.

Example: can ±1 ± 2 ± 3 ± … ± 10 equal 0?

Step 1 / 5
Loading figure…
  1. All plus signs

    Start with everywhere: the sum is , an odd number.

Stop 2 · Integer solutions of equations (Vol. 2)

and differ by , so they have the same parity. Whenever this pair turns up, think parity.

Predict first

and are integers. Can equal ?

Choose an answer first; then you can see the result.

Example: does x² − y² = 2026 have integer solutions?

Step 1 / 5
  1. Factor first

    By the difference of squares, the left side is a product of two integers.

Here parity (mod ) came first; it was not quite enough, so we looked one step further: “is it a multiple of ?” (mod ). A parity argument is the simplest case of choosing a modulus. The Choosing a Good Modulus line is the upgraded version of the same idea.

Stop 3 · Coloring (Vol. 7)

A checkerboard is parity drawn as a picture: color the cell in row , column by whether is odd or even. Moving to a neighboring cell changes by , so the color always changes.

A board has one beetle in every cell. At the whistle, every beetle crawls to a neighboring cell (one that shares a side). Must some cell end up empty?

Example: 25 beetles move house at once

Step 1 / 5
Loading figure…
  1. A first thought

    beetles, cells. With a clever plan, maybe they can all just swap places?

On a board there are cells of each color, and this argument breaks down. In fact, it is then possible to leave no cell empty (just let neighboring beetles swap places in pairs).

Stop 4 · Operations and games (Vol. 7)

Back to the cups at the top of the page: cups mouth up, and each move flips exactly of them.

Example: 7 cups, flip 4 at a time: can they all face down?

Step 1 / 5
Loading figure…
  1. Watch one number

    Ignore which cups are which; just count how many cups face down. At the start it is .

Change one number and the conclusion changes. Below, you flip cups at a time: the change is odd, so the parity switches on every move. Can it be done this time? In how few moves?

Loading figure…
cups, flip each move. Parity no longer blocks the way, but “parity does not block it” is not the same as “it can be done”: it only counts once you have actually flipped them all.

Practice

Exercise 1Basic

What is the remainder when is divided by ? (Enter or ; do not work out the sum.)

Exercise 2Advanced

The numbers are written on a board. Each time, you erase any two numbers and and write their difference . After doing this times only one number is left. Is it odd or even?

Exercise 3Challenge

Of the four numbers , exactly one cannot be written as a difference of two integer squares . Which one?

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

The sum is even, so both numbers are even

The wrong step: is even, so and are both even.
What went wrong? Think first, then open

Diagnosis is even too. An even sum only tells you that and have the same parity: both even or both odd. Forget the “both odd” half and your argument is missing a whole case.

The right step: is even and have the same parity. Then split into two cases: “both even” and “both odd”. And remember: is even, and negative numbers are odd or even too ( is odd).

“Even = even + even, and also = odd + odd”

Exhibit

The parity checks out, so it can be done

The wrong step: : take and both odd; then the left side is even and so is the right side. The parity matches, so the equation has integer solutions.
What went wrong? Think first, then open

Diagnosis Matching parity is only a necessary condition. Actually try it: the squares are just , and no two of them add up to . In fact, look at remainders when dividing by : the sum of two odd squares leaves , while leaves .

The right step: A parity argument can only show “it cannot be done”. To show “it can be done” you must give an actual method or an actual solution. When parity shows no contradiction, try again with a finer modulus.

“Parity can rule things out, but it can never rule them in”

Stops on this line

The same idea, used once in each of several places.

  1. Odd and Even NumbersVol. 6 Divisibility, Congruences and Diophantine Equations, §2.4
  2. Integer Solutions of EquationsVol. 2 Equations and Systems of Equations, ch. 15
  3. ColoringVol. 7 Fun Problems in Combinatorics, ch. 3
  4. Operations and GamesVol. 7 Fun Problems in Combinatorics, ch. 4