How does the Euclidean algorithm keep the GCD while replacing the pair of numbers?
Conditions
- is a nonnegative integer.
- is a positive integer.
- The operation computes the remainder of divided by .
Reasoning, step by step
- Start with a pair of nonnegative and positive .
- Compute the remainder of divided by .
- Replace the pair with .
- Repeat the process until the second argument is zero.
Example
For nonnegative and positive , the Euclidean step is . The remainder is smaller than , which makes repeated steps terminate.
Common misconceptions
- Believing that the remainder can be larger than or equal to the divisor.
- Thinking that the algorithm requires both numbers to be positive at every step, ignoring the base case where the second argument becomes zero.
Watch the explanation
Connected concepts
Explore next
Related questions
The greatest common divisor of 10 and 15 is 5. This is determined by listing the common positive divisors of both numbers, which are 1 and 5, and selecting the largest one.
Conditions: The inputs are the positive integers 10 and 15.; The method used is listing all common positive divisors.
Yes, in this context, "greatest common factor" is being used for what is more commonly called the greatest common divisor in many modern texts. The mathematical procedure shown is the same subtraction-based Euclidean algorithm.
Conditions: Used informally in the explanation of why the algorithm works.
To find the GCF by listing factors, list all positive factors of the first number, list all positive factors of the second number, identify the factors that appear in both lists, and select the largest number from the common factors.
Conditions: The inputs are positive integers.; Listing is practical for the small examples; it is not asserted to be the fastest method.
To start the Euclidean algorithm for , you write the larger number as the smaller number multiplied by an unknown quotient plus an unknown remainder. Specifically, you set up the division equation .
Conditions: The inputs are positive integers.; The larger number is placed on the left-hand side of the equation.; The quotient is an integer and the remainder satisfies .
The Euclidean algorithm terminates because the remainder in each step is strictly smaller than the previous divisor. Since the second argument is a nonnegative integer that decreases with each step, it must eventually reach zero.
Conditions: The algorithm operates on nonnegative integers.; Each step replaces the pair with .; The remainder is strictly less than when .
Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.