Reduce the larger pile
Subtracting the smaller positive integer from the larger preserves their common divisors. Repeating the operation leads to a much smaller equivalent gcd problem.
Proof of Concept · YouTube · 13:28
Explain and justify the Euclidean algorithm using subtraction, remainders and an invariant common divisor.
Use the learning inspector for key ideas and moments, or open the reading tabs for the complete notes.
Generated from the video's visuals and explanation; not verbatim speech.
Subtracting the smaller positive integer from the larger preserves their common divisors. Repeating the operation leads to a much smaller equivalent gcd problem.
An integer divides both a and b exactly when it divides both a and . Consequently the sets of common divisors, and hence the gcd, stay the same.
For b=aq+r with , replace (a,b) by (r,a). Continue until one entry is zero; the other is the gcd. For nonnegative n, gcd(n,0)=n.
Subtracting the smaller positive integer from the larger preserves their common divisors. Repeating the operation leads to a much smaller equivalent gcd problem.
An integer divides both a and b exactly when it divides both a and . Consequently the sets of common divisors, and hence the gcd, stay the same.
For b=aq+r with , replace (a,b) by (r,a). Continue until one entry is zero; the other is the gcd. For nonnegative n, gcd(n,0)=n.
Subtracting the smaller positive integer from the larger preserves their common divisors. Repeating the operation leads to a much smaller equivalent gcd problem. An integer divides both a and b exactly when it divides both a and . Consequently the sets of common divisors, and hence the gcd, stay the same. For b=aq+r with , replace (a,b) by (r,a). Continue until one entry is zero; the other is the gcd. For nonnegative n, gcd(n,0)=n.
For a nonnegative integer , the greatest common divisor of and is itself. This serves as the base case for the Euclidean algorithm, terminating the recursion when the second argument becomes zero.
Conditions: is a nonnegative integer.; The pair is .
The Euclidean algorithm using division terminates when one of the entries in the current pair becomes zero. Specifically, when the remainder in the step becomes zero, the next pair is or , and the algorithm stops, returning the non-zero entry as the gcd.
Conditions: The algorithm uses the step .; and are nonnegative integers.; Termination occurs when the second argument is 0.
Repeating the subtraction operation reduces the magnitude of the numbers involved while preserving their common divisors. Since the numbers are positive integers, they cannot decrease indefinitely.
Conditions: The initial numbers are positive integers.; The operation is subtracting the smaller from the larger.; The goal is to preserve the gcd while reducing the numbers.
Subtracting the smaller positive integer from the larger preserves their common divisors because an integer divides both and exactly when it divides both and . Consequently, the sets of common divisors, and hence the greatest common divisor (gcd), stay the same.
Conditions: and are positive integers.; (so we subtract from ).
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 satisfies (where 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 with .; The step computes with .; The new pair is or depending on implementation, but effectively the max value decreases.
The invariant property is that the set of common divisors of two numbers and is identical to the set of common divisors of and (or and ). This ensures that the greatest common divisor (gcd) remains unchanged throughout the algorithm's steps.
Conditions: and are integers.; The operation is either subtraction () or modulo ().
By the definition of division with remainder, for any integers and (), there exist unique integers and such that and . This constraint on ensures that the remainder is always strictly smaller than the divisor , which is crucial for the algorithm's termination.
Conditions: is a positive integer.; is a nonnegative integer.; The operation is .
Replacing many subtractions by division simplifies the algorithm by using the remainder directly. For with , the pair is replaced by .
Conditions: and are nonnegative integers.; where .; The algorithm proceeds by replacing the pair with .