IT235 Discrete Structure

Discrete StructureTU Board 2023

Use the Extended Euclidean algorithm to find the GCD of 20 and 24.

3

Answer

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:

  1. Initialization: We start with and . The algorithm proceeds by repeatedly applying the division algorithm:

  2. First Iteration: Divide 28 by 16: Now, replace with and with :

  3. Second Iteration: Divide 16 by 12: Update and :

  4. 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:

  1. From Step 2:
  2. From Step 3: Substitute from Step 2: Thus, and .

Verification:

This confirms the correctness of the solution.

Discussion

Loading…

More Discrete Structure questions

All Discrete Structure old questions