Invariance Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Invariance.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

A property of a mathematical object that remains unchanged when the object undergoes a particular transformation or operation.

What stays the same when things change? That's often the key.

Read the full concept explanation →

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: An invariant is the quantity or property that does not change while a transformation acts on everything else.

Common stuck point: The procedure for invariance is the easy part; the trap is saying invariant without naming the transformation. Asking "Is there a quantity that stays exactly the same every time the given transformation is applied?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Is there a quantity that stays exactly the same every time the given transformation is applied?

Worked Examples

Example 1

easy
Show that the sum of the digits of a multiple of 9 is always a multiple of 9. Verify with n=198n = 198 and n=729n = 729.

Answer

9n9(digit sum of n)9 \mid n \Leftrightarrow 9 \mid (\text{digit sum of }n)

First step

1
Any integer nn can be written as n=iai10in = \sum_i a_i \cdot 10^i where aia_i are digits. Since 101(mod9)10 \equiv 1 \pmod{9}, we get niai(mod9)n \equiv \sum_i a_i \pmod{9}.

Full solution

  1. 2
    So 9n9(sum of digits)9 \mid n \Leftrightarrow 9 \mid (\text{sum of digits}) — the divisibility by 9 is an invariant property shared by nn and its digit sum.
  2. 3
    Check n=198n=198: digit sum =1+9+8=18= 1+9+8 = 18, which is a multiple of 9. And 198=9×22198 = 9 \times 22. Confirmed.
  3. 4
    Check n=729n=729: digit sum =7+2+9=18= 7+2+9 = 18, multiple of 9. And 729=9×81729 = 9 \times 81. Confirmed.
An invariant is a property preserved across transformations. Here, taking digit sums preserves divisibility by 9 because of how 10 behaves modulo 9.

Example 2

medium
A sequence starts at 1 and each step either doubles the value or adds 3. Show that the parity (odd/even) of the value changes predictably and identify an invariant.

Example 3

medium
On a board are the numbers 1,2,3,,1001, 2, 3, \dots, 100. You may replace any two numbers a,ba, b with ab|a-b|. After 99 such operations, one number remains. Is its parity determined, and if so, what is it?

Example 4

medium
Show that the sum i=1nai\sum_{i=1}^n a_i is invariant under any permutation σ\sigma of the indices {1,2,,n}\{1,2,\dots,n\}.

Example 5

hard
In a row of integers, you may pick two adjacent numbers a,ba,b and replace them with a+ba+b and aba-b (in that order). Show the sum of squares is invariant.

Example 6

hard
Show that an odd permutation cannot be written as a composition of an even number of transpositions.

Example 7

challenge
An n×nn \times n grid is filled with ±1\pm 1. In one step you may flip the signs in any row or column. Find an invariant that determines reachability.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
Show that the expression x2+y2x^2 + y^2 is invariant under the transformation (x,y)(x,y)(x, y) \mapsto (-x, -y).

Example 2

medium
In a game, you start with the number 6. Each move you may subtract 1 or divide by 2 (if even). Show that the quantity n(mod3)n \pmod{3} is not always preserved and find an invariant that is preserved.

Example 3

easy
When you rotate a square about its center, what stays the same about it?

Example 4

easy
You add 55 to both sides of x=3x = 3. What is invariant?

Example 5

easy
Under reflection across a line, is the area of a triangle invariant?

Example 6

easy
Is the perimeter of a rectangle invariant when you scale it by a factor of 22?

Example 7

easy
What is invariant when you multiply both sides of 2x=62x = 6 by 12\frac{1}{2}?

Example 8

easy
Under any rotation, is the distance between two points invariant?

Example 9

easy
When you reorder the addends 3+53 + 5 to 5+35 + 3, what is invariant?

Example 10

easy
Is the number of vertices of a polygon invariant under rotation?

Example 11

medium
A checkerboard has 3232 black and 3232 white squares. A domino always covers one black and one white square. After placing several dominoes, what stays invariant about the difference (black covered) minus (white covered)?

Example 12

medium
Two opposite corners are removed from an 8×88\times 8 board (both same color). Using the domino color invariant, can the remaining 6262 squares be tiled by dominoes?

Example 13

medium
What quantity is invariant under the transformation xxx \mapsto -x for the function f(x)=x2f(x)=x^2?

Example 14

medium
A frog jumps on a number line, each jump ±2\pm 2. Starting at 00, what is invariant about the parity of its position?

Example 15

medium
In the equation 3x+7=73x + 7 = 7, subtract 77 from both sides. What is invariant and what is the result?

Example 16

medium
Under the map that swaps aa and bb, is the expression a2+b2a^2 + b^2 invariant?

Example 17

medium
Numbers 11 through 77 are written; you may replace any two by their difference (larger minus smaller). The sum starts at 2828. What is invariant about the sum's parity?

Example 18

challenge
Numbers 1,2,,10241,2,\dots,1024 are on a board. Repeatedly erase two numbers a,ba,b and write ab|a-b|. After 10231023 steps one number remains. Show its parity is determined, and find that parity.

Example 19

challenge
A 5×55\times5 grid has 1313 cells of one color and 1212 of the other in a checkerboard pattern. Explain why this color count is an invariant obstruction proving the grid cannot be tiled by 1×21\times2 dominoes.

Example 20

challenge
Let f(x,y,z)f(x,y,z) be invariant under all permutations of x,y,zx,y,z. If f=x+y+zf = x+y+z at one point equals 66 and you permute the inputs, what is the most you can conclude about ff after permutation?

Example 21

medium
A token sits at 00 on a number line; each move adds 33 or subtracts 33. What is invariant about its position mod 33?

Example 22

medium
Under the substitution xx+2πx \mapsto x+2\pi, is sinx\sin x invariant?

Example 23

easy
You replace x=7x = 7 with x+4=11x + 4 = 11. Is the solution set invariant?

Example 24

easy
A bag has 55 red and 77 blue marbles. You shuffle them. What is invariant?

Example 25

easy
Numbers 1,2,3,4,51,2,3,4,5 are on a board. You repeatedly replace two numbers by their sum. Is the sum of all numbers on the board invariant?

Example 26

easy
Are the digits' sum mod 99 invariant when you permute the digits of a number? (e.g., 234423234 \to 423)

Example 27

medium
A knight starts at (0,0)(0,0) on an infinite chessboard. After any number of knight moves, what is invariant about (x+y)(mod2)(x + y) \pmod 2?

Example 28

medium
In the equation 4(x1)=124(x-1) = 12, divide both sides by 44. What is invariant and what is the result?

Example 29

medium
Under the swap (a,b)(b,a)(a, b) \mapsto (b, a), is the expression a2b2a^2 - b^2 invariant?

Example 30

medium
A lamp toggles ON/OFF each press. After 20252025 presses starting from OFF, what state is it in, and which invariant tells you?

Example 31

medium
Numbers 1,1,2,3,5,81, 1, 2, 3, 5, 8 are on a board. You may replace any two numbers a,ba,b with aba \cdot b. Is the product of all numbers on the board invariant?

Example 32

medium
In an 8×88\times 8 checkerboard with TWO opposite corners removed (same color), explain in one line why no domino tiling exists.

Example 33

hard
You have 2020 stones in piles of sizes 5,7,85, 7, 8. Each move: pick two piles, remove one stone from each. What invariant determines whether you can reach the configuration (0,0,0)(0,0,0)?

Example 34

hard
A token at (0,0)(0,0) on the integer plane can move by (+2,+3)(+2, +3) or (1,+4)(-1, +4). What is invariant about its position mod a small number?

Example 35

hard
On a board are 3030 pluses and 2525 minuses. Each step: erase two signs; if they were equal, write a plus; if different, write a minus. After 5454 steps, one sign remains. Which one?

Example 36

hard
1515 numbers are on a board, starting at 1,2,,151, 2, \dots, 15. Each step: replace two numbers a,ba, b with a+b1a+b-1. After 1414 steps, one number remains. Find it.

Example 37

hard
Under the substitution x1/xx \mapsto 1/x, the function f(x)=x+1/xf(x) = x + 1/x is mapped to ____.

Example 38

hard
For a triangle with sides a,b,ca, b, c, the quantity a+b+ca+b+c is the perimeter. Under any relabeling of vertices, what kind of invariant is this?

Example 39

challenge
A frog on the integer line at 00 can jump ±2\pm 2 or ±5\pm 5. Which positions can it reach?

Example 40

challenge
Three jars contain a,b,ca, b, c liters of water with a+b+c=9a+b+c = 9. A move: pick two jars and equalize them (each gets the average). Find an invariant.

Background Knowledge

These ideas may be useful before you work through the harder examples.

transformation geo