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

Invariants and Monovariants

In the Chinese book: 不变量与恒增(减)量

Moves vary endlessly; watch a quantity that never changes or only goes one way.

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

One idea, one pictureEach time, tap two numbers; they are erased and the absolute value of their difference is written. Do it a few times and see which quantity below has “never changed” and which has “never increased”.

Loading figure…

In one sentence

A process changes at every step, but if some quantity never changes at any step, then

The end point is locked by it: states with a different value of can never be reached. If a quantity never increases (a decreasing monovariant) and is a non-negative integer, the process cannot go on forever; if it never decreases and actually grows, you can never get back to the start. Looking for such a quantity is the first reflex for problems about “operations”.

Predict first

The numbers are written on a board. Each time, erase two numbers and write . In the end one number is left. Can it be ?

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

Example: 1, 2, 3, 4, 5. Each time, replace a, b by a + b + ab. What is left at the end?

Step 1 / 4
Loading figure…
  1. Find the change

    looks messy, but add and it factors: .

Stop 1 · Periodic sequences (Vol. 5)

If an integer sequence has a bounded invariant, it can only take finitely many states, so it must be periodic.

Example: a₁ = 1, a₂ = 3, aₙ₊₂ = aₙ₊₁ − aₙ. Why is it periodic?

Step 1 / 3
  1. Find an invariant quadratic

    Write two neighboring terms as ; the next pair is . Try :

Stop 2 · Iteration: two means (Vol. 2)

Iterate two numbers at once: one quantity is invariant and two are monotonic, so the limit gets squeezed out.

Example: x₀ = 1, y₀ = 4, xₙ₊₁ = (xₙ + yₙ)/2, yₙ₊₁ = 2xₙyₙ/(xₙ + yₙ)

Step 1 / 3
  1. The invariant

    The arithmetic mean times the harmonic mean:

Stop 3 · Rotating the axes: invariants of a conic (Vol. 7)

When the coordinate axes are rotated, the coefficients of all change, but and do not.

Example: what curve is 5x² + 4xy + 2y² = 6?

Step 1 / 3
  1. Two invariants

    After rotating to remove the term we get . The invariants give:

Stop 4 · An increasing monovariant: no way back (Vol. 5)

Infinite descent says that a positive integer cannot decrease forever. In the other direction, a quantity that strictly increases means you can never return to the start.

Loading figure…
Each time, replace by and . Make a few moves: how does change? Can you get back to ?

One problem, several solutions

The board shows . Each time, replace two numbers by and . Can appear again after some moves (at least one)?

Sum of squares: an increasing monovariant

, so a move increases by : it never decreases. In the first move both numbers are positive, so becomes strictly larger than ; after that it never decreases, so it can never return to . Answer: no.

CostOnce you find Σx², you are done.

The sum: another increasing monovariant

The new sum is , which is more than before, so the sum never decreases either. The starting numbers are pairwise different, so after the first move the sum is strictly larger than ; it never decreases after that, so again there is no way back.

CostWorks just as well, but watch out: it does not grow when the two numbers are equal.

Practice

Exercise 1Basic

The numbers are written on a board. Each time, erase two numbers and write , until one number is left. What is its remainder on division by ?

Exercise 2Basic

The numbers are written on a board. Each time, erase two numbers and write . What number is left at the end?

Exercise 3Advanced

The numbers are written on a board. Each time, erase two numbers and write . What number is left at the end?

Exercise 4Challenge

Rotating the coordinate axes turns the curve into . Find and decide what type of curve it is.

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 invariant does not object, so it must be possible

The wrong step: The board shows ; each time, erase and write . The parity of the sum does not change (the sum is , even), so the last number can be any even number, such as or .
What went wrong? Think first, then open

Diagnosis An invariant gives only a necessary condition. There are other restrictions: the largest number never increases, so the last number is at most , and is out of the question. Whether can be reached has to be shown by actually doing it (, , ).

The right step: Use invariants (and monovariants) to rule out impossible end points, then give a sequence of moves for each remaining candidate.

“The invariant says “no”; only a construction says “yes””

Exhibit

Taking a quantity that changes for an invariant

The wrong step: Erase and write : the total does not change, so starting from , the number left at the end is .
What went wrong? Think first, then open

Diagnosis becomes , so the total drops by : the total is a decreasing monovariant, not an invariant. What stays the same is its parity, because the drop is even.

The right step: Check first: by how much does the quantity change in one move? Only if the change is always is it an invariant; if the change is always even, the parity is invariant.

“First compute the “change” caused by one move”

Stops on this line

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

  1. Periodic SequencesVol. 5 Sequences and Mathematical Induction, ch. 8
  2. Applications of IterationVol. 2 Functions and Functional Equations, §6.3
  3. Simplifying by Rotating the AxesVol. 7 Analytic Geometry, §5.2
  4. Well-Ordering and Infinite DescentVol. 5 Sequences and Mathematical Induction, ch. 3