Greatest Common Divisor

Context: FIT1058_MOC · the largest integer dividing both and · reduced via · computed by the Euclidean Algorithm

Quick Revision

  • 🎯 Objective: = greatest with and ➔ symmetric, computable by reduction.
  • 📦 Core Components: easy cases ➔ reduction ➔ smallest positive .
  • ⚡ Key Constraint: reduction preserves common divisors, driving numbers down to a base case.

📝 Core

1. The GCD

  • Definition ➔ greatest with and ; symmetric .
  • Easy cases; ; if else 1.

2. Reduction Theorem

  • Identity.
  • Why and share the same common divisors ().
  • Drive down ➔ repeatedly subtract the smaller to reach an easy base case.

3. Linear-Combination Characterisation

  • Bézout = smallest positive [[Integer Linear Combination|]].
  • Bridge ➔ to Coprimality () and modular inverses.

Key identities:

When It Flips: is also the smallest positive — the bridge to coprimality and modular inverses. Order is irrelevant to the value but convenient (larger first) for the algorithm.

📊 Exam Execution Trace

Applied Exercise

Problem: Compute using the reduction. Derivation Proof / Hand-Calculation Walkthrough:

Final Extracted Output: ; each step preserves the common divisors.

⚠️ Common Mistakes

  • 💡 Subtraction = slow mod ➔ repeatedly subtracting until computes ; one replaces many subtractions (the Euclidean speed-up).

🧠 Active Recall