Invariance Math Example 4
Follow the full solution, then compare it with the other examples linked below.
Example 4
mediumIn a game, you start with the number 6. Each move you may subtract 1 or divide by 2 (if even). Show that the quantity is not always preserved and find an invariant that is preserved.
Solution
- 1 Start: , . Subtract 1: , . Parity of changed — not an invariant.
- 2 Try: parity of . Start even (). Subtract 1 gives odd; divide by 2 gives 3 (odd). From odd, subtract 1 gives even; can't divide.
- 3 Invariant found: the value is always a positive integer, and it strictly decreases toward 1 with each move (both operations reduce ). The positivity of is preserved.
Answer
Not every quantity is invariant. The process of testing candidates — and ruling them out — is how invariants are discovered. Strict decrease is a useful invariant for proving termination.
About Invariance
A property of a mathematical object that remains unchanged when the object undergoes a particular transformation or operation.
Learn more about Invariance →More Invariance Examples
Example 1 easy
Show that the sum of the digits of a multiple of 9 is always a multiple of 9. Verify with [formula]
Example 2 mediumA sequence starts at 1 and each step either doubles the value or adds 3. Show that the parity (odd/e
Example 3 easyShow that the expression [formula] is invariant under the transformation [formula].