Discrete StructureTU Board 2023
Use the Extended Euclidean algorithm to find the GCD of 20 and 24.
3Answer
The Extended Euclidean Algorithm is used to find the greatest common divisor (GCD) of two integers, along with coefficients (x and y) such that . Here, we apply it to find the GCD of 16 and 28.
Step-by-Step Solution:
Initialization: We start with and . The algorithm proceeds by repeatedly applying the division algorithm:
First Iteration: Divide 28 by 16: Now, replace with and with :
Second Iteration: Divide 16 by 12: Update and :
Third Iteration: Divide 12 by 4: Since the remainder is now 0, the algorithm terminates. The last non-zero remainder is the GCD:
Final Result:
The GCD of 16 and 28 is 4.
Finding Coefficients (Optional):
To find integers and such that , we back-substitute the equations:
- From Step 2:
- From Step 3: Substitute from Step 2: Thus, and .
Verification:
This confirms the correctness of the solution.
Discussion
Loading…