Skip to content
← All questions

Why does changing gcd⁡(a,b)\gcd(a,b) to gcd⁡(b,r1)\gcd(b,r_1) make the problem scale smaller?

Changing gcd⁡(a,b)\gcd(a,b) to gcd⁡(b,r1)\gcd(b,r_1) makes the problem scale smaller because the remainder r1r_1 is strictly less than the divisor bb. By replacing the larger number aa with the smaller remainder r1r_1, the inputs to the greatest common divisor function decrease in magnitude with each iteration.

Conditions

  • Integers aa and bb satisfy a≥b>0a \ge b > 0.
  • The remainder r1r_1 satisfies 0≤r1<b0 \le r_1 < b.

Reasoning, step by step

  1. Recall the division algorithm: a=q1b+r1a = q_1b + r_1.
  2. Note that r1<br_1 < b.
  3. Observe that the new pair (b,r1)(b, r_1) has a smaller maximum element than (a,b)(a, b).
  4. Conclude that repeated application of this transformation reduces the problem size until the remainder is 0.

Example

The video explains that the original problem of finding the greatest common divisor of two numbers is transformed into finding the greatest common divisor of a smaller number and a remainder, so the problem scale becomes smaller.

Common misconceptions

  • Believing that the remainder can be larger than the divisor.
  • Thinking that the problem size remains constant during the iterations.

Watch the explanation

Connected concepts

Explore next

Related questions

Understand why

↗
Find a method

↗
Find a method

↗
Find a method

↗
Understand why

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.