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

Parity

In the Chinese book: 奇偶性

Keep only odd or even. Moves that change the value often keep its parity.

📖 Chapter 7 of 《解题方法与策略》

One idea, one pictureThe board shows 1 to 10. Each move erases two numbers and writes their difference. Can you make the last number 0? Play a few rounds and watch the “Parity of the sum” box.

Loading figure…

In one sentence

Integers come in two kinds, odd and even. The properties used most often:

  • and have the same parity;
  • a sum of an odd number of odd numbers is odd, and a sum of an even number of odd numbers is even;
  • a product of integers is odd if and only if every factor is odd.

The power of a parity argument: it keeps just one piece of information, the value “mod ”, and that is often exactly the part of the problem that does not change.

Predict first

The board shows . Each move erases any two numbers and writes . After moves one number is left. Can that number be ?

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

Example: erase two of 1 to 10, write the difference; the last number is odd

Step 1 / 4
Loading figure…
  1. Find a quantity

    Each move touches only two numbers, so look at the sum of all the numbers, . At the start .

Stop 1 · The Principle of Classification (Vol. 1)

Sort the integers into two classes by parity, and the problem becomes one about how the two classes are arranged.

Example: can 1, 2, …, n be arranged in a circle so that every two neighbors have an odd sum?

Step 1 / 4
  1. What an odd sum means

    A sum of two numbers is odd one is odd and one is even. So odd and even numbers must alternate around the circle.

Stop 2 · Periodic Sequences (Vol. 5)

The sequence itself keeps growing, but its parity has only two states, and it is often periodic.

Example: a₁ = a₂ = 1, aₙ₊₂ = aₙ₊₁·aₙ + 1. Is a₁₀₀ odd or even?

Step 1 / 4
  1. Track only the parity

    odd × odd + 1 = even, odd × even + 1 = odd, even × odd + 1 = odd.

Stop 3 · The Fibonacci Sequence (Vol. 5)

One problem, several solutions

The Fibonacci sequence: , . Prove that is even if and only if .

The parity is periodic

Mod : . Each term is decided by the two before it, and , so the shadow has period .

So .

CostThe most direct: squash the sequence down to its mod 2 “shadow”.

Induction with step 3

, so .

Check that are odd and is even, then use induction with step size : three chains cover .

CostNo mention of periods, just induction; first stretch the recurrence over three steps.

Practice

Exercise 1Basic

The board shows . Each move erases two numbers and writes the absolute value of their difference. What remainder does the last number leave when divided by ?

Exercise 2Basic

How many of the first Fibonacci numbers are even?

Exercise 3Advanced

is a polynomial with integer coefficients, and and are both odd. Prove that has no integer root.

Exercise 4Challenge

Each of is or , and . What is the smallest positive integer for which this is possible?

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 must be even

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

Diagnosis An even only says that and have the same parity. is a sum of two odd numbers. Miss the “both odd” case and you have done only half of the argument.

The right step: Write: is even . Then treat the two cases “both even” and “both odd”.

“Even = even + even = odd + odd”

Exhibit

The parity matches, so it can be done

The wrong step: The board shows ; each move erases two numbers and writes their difference. The sum is (odd), so the last number can be any odd number, for example .
What went wrong? Think first, then open

Diagnosis A parity invariant only tells you that an even number cannot be reached. It does not promise that every odd number can. In fact each difference written is no bigger than the largest number on the board, so the last number is at most : is out of reach.

The right step: Parity can only rule things out. To say “it can be done”, you must give an actual sequence of moves.

“Parity can only say “impossible””

Stops on this line

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

  1. The Principle of ClassificationVol. 1 Sets, ch. 7
  2. Periodic SequencesVol. 5 Sequences and Mathematical Induction, ch. 8
  3. The Fibonacci SequenceVol. 5 Sequences and Mathematical Induction, ch. 9