Skip to content
← All questions

How does replacing many subtractions by division simplify the Euclidean algorithm?

Replacing many subtractions by division simplifies the algorithm by using the remainder directly. For b=aq+rb=aq+r with 0≤r<a0 \le r < a, the pair (a,b)(a,b) is replaced by (r,a)(r,a). This step effectively performs multiple subtractions at once, reducing the numbers much faster until one entry is zero.

Conditions

  • aa and bb are nonnegative integers.
  • b=aq+rb = aq + r where 0≤r<a0 \le r < a.
  • The algorithm proceeds by replacing the pair (a,b)(a,b) with (r,a)(r,a).

Reasoning, step by step

  1. Identify the larger number bb and the smaller number aa.
  2. Perform division with remainder: b=aq+rb = aq + r.
  3. Note that rr is the result of subtracting aa from bb repeatedly qq times.
  4. Replace the pair (a,b)(a,b) with (r,a)(r,a).
  5. Repeat the process with the new pair.
  6. Continue until one entry in the pair is zero.
  7. The other entry is the gcd.

Example

The script states: 'For b=aq+r with 0≤r<a0\le r<a, replace (a,b) by (r,a). Continue until one entry is zero; the other is the gcd.'

Common misconceptions

  • Thinking that the quotient qq is needed for the next step, whereas only the remainder rr matters.
  • Believing that the order of replacement doesn't matter, but it must be (remainder,previous divisor)(remainder, previous\ divisor) to maintain the invariant.

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.