Invariants and monovariants
This chapter introduces the powerful concepts of invariants and monovariants, essential tools for analyzing discrete processes and move-based games. Mastery of these techniques is crucial for solving a significant class of problems in combinatorics, frequently appearing in competitive examinations to determine game outcomes or process termination.
---
Chapter Contents
|
| Topic |
|---|-------| | 1 | Move-based games | | 2 | Invariant idea | | 3 | Monovariant idea | | 4 | Process termination questions |---
We begin with Move-based games.
Part 1: Move-based games
Move-based Games
Overview
Move-based games and state-evolution problems are central in combinatorics. A position changes by legal moves, and the real question is usually not “what happens next?” but “what can never change?”, “what must keep changing?”, or “what structure is forced by a greedy rule?”. In CMI-style questions, this topic often mixes invariants, monovariants, parity, extremal arguments, and optimality proofs. The 2025 PYQ around card stacks is a perfect example: a legal move rule creates a structured process, and the proof requires showing that some order is preserved, some quantity grows in a controlled way, and the final greedy outcome is optimal. ---Learning Objectives
After studying this topic, you will be able to:
- Model a move-based process as a sequence of legal states.
- Identify useful invariants and monovariants.
- Use parity and order-preservation arguments in game states.
- Prove greedy optimality by comparing with all possible strategies.
- Connect move-based stack processes with increasing subsequences and extremal structure.
Core Idea
A move-based game or process consists of:
- an initial state,
- a set of legal moves,
- a rule for changing the state,
- and a target question such as:
- can the game end?
- can a position be reached?
- who has a winning strategy?
- is a greedy strategy optimal?
- what is the minimum or maximum possible final value?
An invariant is a quantity or property that remains unchanged after every legal move.
If a target state has a different value of that invariant, then that state is impossible.
A monovariant is a quantity that always moves in one direction under every legal move.
Examples:
- always increases,
- always decreases,
- never increases,
- never decreases.
A monovariant is useful for proving termination or bounding the number of moves.
The Three Main Tools
When analysing a move-based game, ask:
- Invariant: What cannot change?
- Monovariant: What must move only one way?
- Extremal choice: If I choose the smallest/largest/leftmost/rightmost possible move, what structure appears?
For a new move-based problem, do not start by simulating many moves. Start by listing:
- parity,
- order,
- total sum,
- number of piles/stacks/components,
- maximum/minimum entry,
- sortedness of a special set of representatives,
- length of a best chain or subsequence.
Parity and Reachability
If each move changes a quantity by an even number, then parity stays fixed.
So if the starting position has even parity and the target needs odd parity, the target is impossible.
This is one of the simplest and most powerful impossibility arguments.
Order-Based Processes
Many greedy algorithms generate a special ordered object:
- stack tops become increasing,
- pile sizes become nondecreasing,
- chosen representatives become sorted,
- breakpoints move only in one direction.
Once such an ordered feature is proved, it becomes the main invariant-like structure controlling the process.
Greedy Stack Process
Cards with distinct numbers arrive one by one. A card may be placed only on top of a larger number, or may start a new stack.
In the greedy strategy:
- place the incoming card on the leftmost stack where it can legally go,
- if no stack works, start a new stack on the far right.
Under this greedy rule, the top cards of the stacks increase from left to right.
This is not obvious at first, but once proved, it controls the entire process.
Longest Increasing Subsequence Connection
For a sequence , let
Then in the greedy stacking process, the number of stacks turns out to equal the length of a longest increasing subsequence.
- the stacks encode a lower bound on possible increasing subsequences,
- and increasing subsequences force at least that many stacks in any legal decomposition.
Why Greedy Optimality Usually Needs Two Proofs
To prove a greedy strategy is optimal, usually show:
- Greedy gives at most some value
- Every strategy needs at least that value
If both values match, greedy is optimal.
- greedy creates exactly stacks,
- every increasing subsequence of length forces at least stacks,
- hence no strategy can do better.
Minimal Worked Example
Example Process the sequence using the greedy stacking rule.- : start stack 1
- : cannot go on , so start stack 2
- : place on stack 1
- : place on stack 2
- : start stack 3
- : place on stack 2
- : start stack 4
- : place on stack 4
Typical Proof Structures
- Show legality is preserved
- Show a key ordered quantity is preserved
- Show every move changes a monovariant in one direction
- Show a candidate extremal object gives a lower bound
- Show greedy attains that lower bound
Winning Strategies in Move-Based Games
A position is often called:
- P-position if the Previous player can force a win, equivalently the Next player loses with best play
- N-position if the Next player can force a win
A position is:
- P if every legal move goes to an N-position
- N if there exists a legal move to a P-position
Common Techniques for This Topic
- Parity method: track odd/even behavior
- Coloring method: black-white coloring often creates an invariant
- Potential function: define a numeric score that always changes in one direction
- Greedy representative method: study first/leftmost/smallest possible legal placement
- Extremal chain method: use longest increasing/decreasing subsequences as lower bounds
Common Mistakes
- ❌ Checking only a few sample moves and assuming a pattern is always true
- ❌ Claiming a quantity is invariant when it actually changes
- ❌ Confusing “greedy works” with “greedy is optimal”
- ❌ Using subsequences and subsets interchangeably
- ❌ Forgetting that the legal move rule itself can force hidden order in the state
CMI Strategy
- Write the state clearly.
- Write exactly what a legal move changes.
- Search for parity, ordering, sum, or extremal-position behavior.
- If greedy is used, prove the structural property it preserves.
- To prove minimum/maximum, compare with a universal lower/upper bound.
- If the problem asks whether a state is reachable, try invariants before construction.
Practice Questions
:::question type="MCQ" question="In a move-based process, a quantity that never changes after any legal move is called" options=["a monovariant","an invariant","a subsequence","a greedy bound"] answer="B" hint="Focus on the word 'never changes'." solution="A quantity that remains unchanged after every legal move is called an invariant. Therefore the correct option is ." ::: :::question type="NAT" question="A process starts with the number . Each legal move subtracts . After exactly legal moves, what number is obtained?" answer="2" hint="This is a direct state update." solution="Each move subtracts . So after moves, the total decrease is Hence the new value is So the answer is ." ::: :::question type="MSQ" question="Which of the following are standard useful tools in move-based games?" options=["Invariants","Monovariants","Parity arguments","Ignoring the legality of moves"] answer="A,B,C" hint="Think of standard proof techniques." solution="Invariants, monovariants, and parity are standard tools. Ignoring legal move conditions is never valid. Hence the correct answer is ." ::: :::question type="SUB" question="Explain why a monovariant can be used to prove that a process must terminate." answer="Because it moves only in one direction and cannot do so indefinitely if bounded." hint="Think about a quantity that always decreases or always increases." solution="Suppose a quantity is associated to every state, and every legal move makes strictly decrease. If is bounded below, then the process cannot continue forever, because an infinite strictly decreasing sequence of integers cannot exist. Similarly, if strictly increases but is bounded above, the process must terminate. Hence a bounded monovariant proves termination." ::: ---Summary
- Move-based games are analysed through legal states and legal moves.
- Invariants prove impossibility; monovariants prove progress or termination.
- Greedy strategies need structural proofs, not just examples.
- In order-based processes, hidden monotone structures often appear.
- The 2025 stack PYQ is a model example of combining greedy structure, subsequences, and optimality.
---
Proceeding to Invariant idea.
---
Part 2: Invariant idea
Invariant Idea
Overview
An invariant is a quantity or property that remains unchanged throughout an allowed process. In combinatorics and discrete mathematics, invariants are one of the strongest tools for proving that something is impossible, or that the system can only end in certain types of states. In CMI-style problems, the real challenge is usually not computation, but finding the right quantity that stays fixed. ---Learning Objectives
After studying this topic, you will be able to:
- Recognize when a process suggests an invariant.
- Use invariants to prove impossibility.
- Track parity, residue classes, color counts, and other preserved quantities.
- Distinguish between a true invariant and a merely useful quantity.
- Use invariant-based reasoning in puzzles, games, and transformation problems.
Core Idea
An invariant is a quantity, parity, residue class, coloring balance, or structural property that does not change under the allowed move.
If the initial state has a certain invariant value and the target state has a different one, then the target state is impossible to reach.
The Basic Strategy
- Understand the allowed move exactly.
- Guess a quantity that may stay unchanged.
- Prove that every legal move preserves it.
- Compare the invariant in the initial and final states.
- If they differ, the desired transition is impossible.
Most Common Types of Invariants
Common invariant choices include:
- parity of a number
- sum modulo
- color balance on a colored board
- parity of inversions
- gcd in certain number processes
- total sum in redistribution moves
- position class under modular arithmetic
If every move changes a quantity by an even number, then its parity is invariant.
This is one of the fastest and most useful checks in discrete problems.
Example Patterns
Pattern 1: Parity invariant If every move changes the number of heads by , , or , then the parity of the number of heads never changes. So starting from an even number of heads, you can never reach an odd number of heads. --- Pattern 2: Coloring invariant If each move always covers one black and one white square on a checkerboard, then the difference behaves predictably and can reveal impossibility. This is the core idea behind many tiling problems. --- Pattern 3: Sum modulo If every move changes the total by a multiple of , then the total modulo is invariant. This is stronger than just checking the ordinary sum. ---Minimal Worked Examples
Example 1 A pile contains an even number of stones. In one move, you may add stones or remove stones. Can the pile ever contain an odd number of stones? Each move changes the number of stones by an even number, so parity is invariant. Since the initial number is even, it always remains even. So an odd number of stones is impossible. --- Example 2 A board is colored in black and white like a chessboard. Suppose every move removes two adjacent squares. Why might coloring help? Any adjacent pair contains one black and one white square. So every move removes one black and one white square. Hence the difference between the number of black and white squares removed stays balanced, and this can prove certain tilings impossible. ---Standard High-Value Invariants
When facing a move-based problem, test these first:
- parity modulo
- residue modulo or modulo
- total sum
- total sum of coordinates
- color class of positions
- number of objects of a certain type modulo
What an Invariant Can Prove
An invariant is especially useful for proving:
- a target state is unreachable
- a transformation is impossible
- only certain final states are possible
- two states cannot lie in the same move-equivalence class
Common Mistakes
- ❌ Choosing a quantity that changes under the move
- ❌ Checking a few examples instead of proving preservation
- ❌ Confusing an invariant with a monotone quantity
- ❌ Forgetting to compare initial and target values
- ❌ Using ordinary sum when only sum modulo is preserved
CMI Strategy
- Look for a quantity changed by a fixed multiple.
- Check parity before anything else.
- If the problem involves a board, try coloring.
- If the move redistributes numbers, inspect sum, sum mod , or gcd.
- Once you find a preserved quantity, stop experimenting and write a proof.
Practice Questions
:::question type="MCQ" question="Eight coins lie on a table, all showing tails. In one move, exactly two coins are flipped. Which of the following numbers of heads is impossible to obtain?" options=["","","",""] answer="D" hint="Track the parity of the number of heads." solution="Initially the number of heads is , which is even. Flipping exactly two coins changes the number of heads by , , or , so the parity of the number of heads remains even. Therefore an odd number of heads is impossible. Among the options, only is odd. Hence the correct option is ." ::: :::question type="NAT" question="Eight coins lie on a table, all showing tails. In one move, exactly two coins are flipped. How many different values can the number of heads take?" answer="5" hint="Use parity, then check attainability." solution="The parity of the number of heads is invariant, so only even values are possible. Starting from heads, the possible values are . All of these are achievable by choosing suitable pairs to flip. Hence the number of different possible values is ." ::: :::question type="MSQ" question="Which of the following are useful invariant ideas in discrete problems?" options=["Parity of a quantity","Residue modulo ","A board coloring pattern","A quantity that strictly decreases after every move"] answer="A,B,C" hint="An invariant stays unchanged; a strictly decreasing quantity is a different idea." solution="Parity, residue classes, and coloring arguments are all standard examples of invariants. A quantity that strictly decreases is not an invariant; it is a monovariant. Therefore the correct answer is ." ::: :::question type="SUB" question="A standard chessboard has two opposite corner squares removed. Explain why the remaining board cannot be tiled by dominoes, where each domino covers exactly two adjacent squares." answer="Impossible by coloring invariant" hint="Color the board black and white." solution="Color the board in the usual black-white checkerboard pattern. Every domino placed on the board covers exactly one black square and one white square, because adjacent squares have opposite colors. Now remove two opposite corners. Opposite corners of a chessboard have the same color. So removing them removes two squares of the same color. The remaining board therefore has unequal numbers of black and white squares. Since each domino covers one black and one white square, any domino tiling would cover equal numbers of black and white squares. That is impossible here. Therefore the board cannot be tiled by dominoes. Hence the answer is ." ::: ---Summary
- An invariant is a quantity or property unchanged by every legal move.
- Invariants are especially useful for proving impossibility.
- Parity, residues, coloring, and fixed sums are the first things to test.
- A correct invariant must be proved, not guessed from examples.
- If the invariant differs between the starting and target states, the target is unreachable.
---
Proceeding to Monovariant idea.
---
Part 3: Monovariant idea
Monovariant Idea
Overview
A monovariant is a quantity that always moves in one direction during a process: it always increases or always decreases. Unlike an invariant, it does not stay fixed. In CMI-style problems, monovariants are used to prove that a process must stop, that cycles are impossible, or that certain states cannot repeat. ---Learning Objectives
After studying this topic, you will be able to:
- Recognize when a process suggests a monotone quantity.
- Use a monovariant to prove termination or impossibility of cycles.
- Distinguish clearly between invariant and monovariant reasoning.
- Use inversion count, maximum value, and positive integer measures as monovariants.
- Build short rigorous proofs using bounded monotone quantities.
Core Idea
A monovariant is a quantity that changes in only one direction under every legal move.
For example:
- always decreases
- always increases
If such a quantity is bounded, then the process cannot continue forever in the same way.
Why Monovariants Matter
Monovariants are especially useful for proving:
- the process terminates
- cycles are impossible
- a state cannot reappear
- a target cannot be reached if it would require reversing the monotone direction
The Basic Strategy
- Identify a quantity that changes every move.
- Prove that it always moves in one direction.
- Check whether it is bounded below or above.
- Conclude termination or non-repetition.
Common Monovariants
Common choices include:
- number of inversions in a permutation
- maximum value in a number process
- total sum when every move reduces it
- distance from a target state
- number of disorder pairs
- number of unsorted positions
Strict vs Non-Strict
If the monovariant changes strictly every move, then repetition is impossible.
If it only changes weakly, you may need an additional argument.
For example:
- strictly decreasing nonnegative integer process must stop
- non-increasing real quantity alone may not be enough
Standard Example: Inversions
For a sequence , an inversion is a pair with but .
The total number of inversions measures how far the sequence is from being sorted.
If we swap two adjacent elements that are out of order, the inversion count decreases by exactly .
So inversion count is a monovariant for adjacent-swap sorting processes.
Minimal Worked Examples
Example 1 Suppose you repeatedly swap adjacent out-of-order entries in a list until the list is sorted. The inversion count decreases by at each such swap, and it can never become negative. Therefore the process must terminate. --- Example 2 Start with two unequal positive integers . Replace the larger one by the difference of the two numbers. Then quantities like and strictly decrease while remaining nonnegative. So the process cannot continue forever without eventually reaching equality or zero structure, depending on the exact rule. ---Monovariant Versus Invariant
- An invariant stays unchanged.
- A monovariant changes in one direction.
Boundedness Principle
If a quantity:
- is always an integer
- is always nonnegative
- strictly decreases after every move
then the process must terminate after finitely many steps.
Common Mistakes
- ❌ Choosing a quantity that sometimes increases and sometimes decreases
- ❌ Forgetting to prove boundedness
- ❌ Confusing “usually decreases” with “always decreases”
- ❌ Calling an invariant a monovariant
- ❌ Ignoring whether the quantity is integer-valued or can approach a limit endlessly
CMI Strategy
- Ask whether the problem is about termination, sorting, or no-cycle behavior.
- Look for a natural measure of disorder.
- Check if each move strictly reduces that measure.
- Prove the quantity is bounded.
- Use that to conclude termination or impossibility of repetition.
Practice Questions
:::question type="MCQ" question="In a sorting process, one repeatedly swaps adjacent inverted pairs. Which quantity is a natural monovariant?" options=["Sum of all entries","Product of all entries","Number of inversions","Set of values appearing"] answer="C" hint="Think of a measure of disorder." solution="Swapping an adjacent inverted pair reduces the disorder of the arrangement. The standard quantity that tracks this disorder is the inversion count, and it decreases by exactly at each such swap. Therefore the correct option is ." ::: :::question type="NAT" question="How many inversions are there in the sequence ?" answer="4" hint="Count pairs with and ." solution="The inversions are: , , , and . So the total number of inversions is ." ::: :::question type="MSQ" question="Which of the following can serve as monovariants in suitable discrete processes?" options=["A quantity that strictly decreases each move","Number of inversions in adjacent-swap sorting","Maximum value in a process where the larger number is replaced by a smaller one","A quantity that is preserved exactly at every move"] answer="A,B,C" hint="A monovariant moves in one direction." solution="A monovariant changes in one direction. A strictly decreasing quantity is a monovariant, inversion count is a classic monovariant in sorting, and the maximum value can be a monovariant in certain number processes. A quantity preserved exactly is an invariant, not a monovariant. Hence the correct answer is ." ::: :::question type="SUB" question="Explain why a process cannot continue forever if there is a nonnegative integer-valued quantity that strictly decreases after every move." answer="Strictly decreasing nonnegative integer monovariant implies termination" hint="Use the fact that nonnegative integers cannot decrease indefinitely." solution="Let the quantity be . By assumption, is always a nonnegative integer, and after every move its value strictly decreases. So if the process continued forever, we would get an infinite strictly decreasing sequence of nonnegative integers: But such a sequence cannot exist, because nonnegative integers cannot decrease indefinitely. Therefore the process must stop after finitely many moves. Hence the answer is ." ::: ---Summary
- A monovariant always moves in one direction under the allowed move.
- Monovariants are used to prove termination and no-cycle behavior.
- Inversion count is a standard monovariant for sorting processes.
- A strictly decreasing nonnegative integer quantity forces termination.
- The key is not just monotonicity, but monotonicity plus boundedness.
---
Proceeding to Process termination questions.
---
Part 4: Process termination questions
Process Termination Questions
Overview
Process termination questions ask whether a repeated operation must eventually stop. In discrete mathematics, the standard tools are invariants, monovariants, and the well-ordering principle. In CMI-style problems, the real challenge is to find a quantity that cannot keep changing forever. ---Learning Objectives
After studying this topic, you will be able to:
- identify whether a process is guaranteed to terminate,
- choose a useful invariant or monovariant,
- use integer-valued measures to prove finite termination,
- distinguish between proving termination and proving the final state,
- avoid false arguments based only on intuition.
Core Idea
A process is said to terminate if after finitely many steps no further move is possible.
- An invariant is a quantity that remains unchanged throughout the process.
- A monovariant is a quantity that always moves in one direction, for example always decreases or always increases.
Most Important Principle
Suppose a process has a quantity such that:
- takes values in the non-negative integers,
- strictly decreases after every move.
Then the process must terminate.
Reason: there cannot be an infinite strictly decreasing sequence of non-negative integers.
The non-negative integers are well ordered, so they do not allow infinite descent.
This is the key reason why integer-valued monovariants are so powerful.
Other Useful Termination Frameworks
A process must terminate if any one of the following is true:
- some non-negative integer quantity strictly decreases each step,
- some integer quantity strictly increases but is bounded above,
- the number of possible states is finite and no state can repeat,
- each move reduces a lexicographically ordered pair such as in a well-founded set.
Sometimes one number is not enough. Then define a pair like
and show that after every move:
- either decreases,
- or stays the same and decreases.
This is called lexicographic descent.
How to Find a Good Monovariant
In process problems, test quantities such as:
- total sum,
- number of nonzero objects,
- number of inversions,
- distance from a target configuration,
- maximum or minimum value,
- parity plus an additional decreasing measure,
- area, length, or energy-like quantity.
- easy to compute,
- integer-valued,
- forced to move in one direction.
Minimal Worked Examples
Example 1 A positive integer is repeatedly replaced by . Show that the process terminates. At each step, the value of remains a non-negative integer and strictly decreases whenever . So is a decreasing non-negative integer monovariant. Hence the process must terminate. --- Example 2 Given two positive integers with , replace by whenever . Show that the process terminates. Consider the sum After one move, So the sum strictly decreases and stays a non-negative integer. Hence the process terminates. ---Termination Versus Final Outcome
A proof of termination answers:
It does not automatically answer:
The final state may require a separate invariant or structural argument.
When Invariants Help but Are Not Enough
An invariant alone usually does not prove termination.
For example, parity may remain constant forever, but that does not stop a process from continuing indefinitely.
To prove termination, you typically need a decreasing or increasing quantity with a bound.
Common Patterns
- number processes on positive integers,
- stone-moving or token-moving games,
- reduction processes on pairs or tuples,
- repeated subtraction or replacement rules,
- finite-state games with no repetition possible.
Common Mistakes
- ❌ saying a quantity "usually decreases",
- ❌ using a real-valued quantity with no lower-bound argument,
- ❌ using only an invariant,
- ❌ assuming that boundedness alone proves termination,
CMI Strategy
- First ask: what quantity can never change forever?
- Try total sum, maximum, number of inversions, or number of defects.
- Prefer non-negative integers.
- If one quantity fails, try an ordered pair.
- Separate the proof into:
- monovariant,
- why it is bounded,
- conclusion of termination.
Practice Questions
:::question type="MCQ" question="Which of the following is sufficient to prove that a process terminates?" options=["A quantity remains constant throughout the process","A non-negative integer quantity strictly decreases at every step","A quantity is sometimes smaller than before","The process has a legal move at every stage"] answer="B" hint="Think about infinite descent." solution="A process must terminate if there is a non-negative integer quantity that strictly decreases after every move, because such a quantity cannot decrease indefinitely. Hence the correct option is ." ::: :::question type="NAT" question="A positive integer is repeatedly replaced by . Starting from , after how many steps does the process first reach ?" answer="5" hint="Write the successive values." solution="The successive values are So the process reaches after steps." ::: :::question type="MSQ" question="Which of the following statements are true?" options=["A strictly decreasing sequence of non-negative integers must terminate","An invariant alone is always enough to prove termination","A bounded increasing sequence of integers must eventually stop increasing","If a process has finitely many states and no state repeats, it must terminate"] answer="A,C,D" hint="Think about well-ordering and finite state spaces." solution="1. True. Infinite descent in non-negative integers is impossible.Summary
- Termination is usually proved by a monovariant, not by brute force.
- A decreasing non-negative integer is the strongest standard tool.
- Invariants usually describe preserved structure, not termination.
- Finite state space plus no repetition also gives termination.
- Well-ordering is the hidden principle behind most descent arguments.
---
Chapter Summary
Invariants are quantities or properties that remain unchanged throughout a process or game. They are powerful tools for proving impossibility or specific properties of a final state.
Monovariants (or semi-invariants) are quantities that strictly increase or decrease with each step of a process, and are bounded. They are primarily used to prove that a process must terminate.
Move-based games often yield to invariant analysis, especially when seeking to prove that a certain state is unreachable from an initial state.
Process termination questions are typically tackled using monovariants, by identifying a quantity that is strictly monotonic and bounded, thus guaranteeing the process cannot continue indefinitely.
Common invariant types include parity, sum/product modulo , sum of specific values, or configurations.
Common monovariant types include sum of values, sum of squares, number of "good" or "bad" pairs, or total "energy" of a system.
* Identifying the correct invariant or monovariant is crucial and often requires creative problem reinterpretation.
---
Chapter Review Questions
:::question type="MCQ" question="A standard chessboard has all squares initially white. A move consists of choosing any square and flipping the colors of all four squares within it (white becomes black, black becomes white). Can you reach a state where exactly one square is black?" options=["Yes, by carefully chosen moves.","No, because the parity of the total number of black squares is an invariant.","Yes, if the board size was .","No, because the sum of row parities is invariant."] answer="No, because the parity of the total number of black squares is an invariant." hint="Consider the total number of black squares. How does its parity change with each move?" solution="Let be the total number of black squares. Initially, . When a square is chosen, its four squares' colors are flipped. Each square changes from white to black (+1 to ) or black to white (-1 to ). Thus, the number of black squares in the chosen block changes by , where is the number of white squares that become black, and is the number of black squares that become white, with . The net change in is . Since , we have , which is always an even number. Therefore, the parity of the total number of black squares, , is an invariant. Since starts at 0 (even), it must always remain even. Reaching a state with exactly one black square (, odd) is impossible."
:::
:::question type="NAT" question="You have a list of numbers . In one step, you choose any two numbers and (where ) and replace both with . This process continues until all numbers are equal. If you start with , what is the final common value of all numbers?" answer="2" hint="Consider the minimum value among the numbers. What can be said about it throughout the process?" solution="Let be the set of numbers. In each step, we choose and replace them with . Notice that any number in the set can only decrease or stay the same, as it is replaced by a value less than or equal to itself. Specifically, the minimum value in the set, , is a non-decreasing monovariant (it can only stay the same or increase if a smaller number is replaced by a larger one, but that's not the case here, as we replace both with the minimum).
Let's trace the example:
Start:
All numbers are now equal. The process terminates. The final common value is 2.
More generally, the process must terminate because the sum of the numbers is a non-increasing integer-valued monovariant, bounded below by . The final common value must be the minimum of the initial set of numbers. This is because no number can ever become smaller than the initial minimum, and any number larger than the initial minimum will eventually be replaced by the minimum when paired with it. The initial minimum is 2."
:::
:::question type="MCQ" question="On a circular track, there are 2023 lamps. Initially, exactly one lamp is on, and the rest are off. A move consists of choosing any two adjacent lamps and flipping their states (on to off, off to on). Can you reach a state where all lamps are off?" options=["Yes, by carefully selecting adjacent lamps.","No, because the number of 'on' lamps is a monovariant that always decreases.","No, because the parity of the number of 'on' lamps is an invariant.","Yes, if the number of lamps was even."] answer="No, because the parity of the number of 'on' lamps is an invariant." hint="How does flipping two adjacent lamps affect the total count of 'on' lamps?" solution="Let be the number of 'on' lamps. When two adjacent lamps are chosen and their states are flipped, there are three possibilities for how changes:
In all cases, the change in is an even number (, , or ). This means the parity of the number of 'on' lamps, , is an invariant.
Initially, exactly one lamp is on, so , which is an odd number.
The target state is all lamps off, so , which is an even number.
Since the parity of must remain odd, it is impossible to reach a state where . Therefore, the process cannot reach a state where all lamps are off."
:::
---
What's Next?
Having mastered the powerful techniques of invariants and monovariants, you are now equipped to tackle a wide range of problems involving state changes and process analysis. These concepts are fundamental in Combinatorics and Graph Theory, frequently appearing in problems related to graph coloring, network flows, and game theory. They also lay groundwork for understanding Recurrence Relations and Extremal Principles, where the analysis of how quantities evolve or are bounded is critical. Consider exploring chapters on Graph Algorithms, Combinatorial Games, and Proof Techniques for further application and deeper insight.