Skip to content
← All questions

How does the Euclidean algorithm reduce the problem size in each step?

The Euclidean algorithm reduces the problem size by replacing the larger number with the remainder of the division of the two numbers. Since the remainder rr satisfies 0≤r<a0 \le r < a (where aa is the divisor), the new number is strictly smaller than the previous larger number, ensuring progress towards the base case.

Conditions

  • The current pair is (a,b)(a,b) with b≥a>0b \ge a > 0.
  • The step computes b=aq+rb = aq + r with 0≤r<a0 \le r < a.
  • The new pair is (r,a)(r,a) or (a,r)(a,r) depending on implementation, but effectively the max value decreases.

Reasoning, step by step

  1. Identify the larger number bb and smaller number aa.
  2. Compute the remainder r=b mod ar = b \bmod a.
  3. Note that r<a≤br < a \le b.
  4. Replace the pair (a,b)(a,b) with (r,a)(r,a) (or sort them).
  5. The maximum value in the pair has decreased from bb to aa (or potentially rr).
  6. Repeat until the remainder is 0.

Example

The script states: 'For b=aq+r with 0≤r<a0\le r<a, replace (a,b) by (r,a).'

Common misconceptions

  • Thinking that the quotient qq reduces the problem size.
  • Believing that the numbers decrease by a fixed amount each step.
  • Confusing the reduction in magnitude with the preservation of the gcd.

Watch the explanation

Connected concepts

Explore next

Related questions

Understand why

↗
Find a method

↗
Find a method

↗
Know when to use it

↗

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