2079 12

CSC165 · 2079 · 5 marks

Find the GCD of 24 and 32 using Extended Euclidean algorithm.

Find the GCD of 24 and 32 using Extended Euclidean algorithm. [5]

Discrete StructuresChapter 2: Integers and MatricesExtended Euclidean AlgorithmNumerical: extended Euclidean algorithm

GCD of 24 and 32 Using the Extended Euclidean Algorithm

Given

  • $a = 32$, $b = 24$ (arrange larger first)
  • Goal: find $\gcd(24, 32)$ and Bezout coefficients $s, t$ such that $\gcd = s \cdot a + t \cdot b$.

Solution

Euclidean Algorithm (successive division)

StepEquationQuotientRemainder
1$32 = 1 \cdot 24 + 8$18
2$24 = 3 \cdot 8 + 0$30

The last non-zero remainder is $8$.

$$\gcd(24, 32) = 8$$

Back-Substitution (Extended part)

From Step 1:

$$32 = 1 \cdot 24 + 8$$

Solve for the remainder $8$:

$$8 = 32 - 1 \cdot 24$$

Written as a linear combination:

$$\boxed{8 = (1)\cdot 32 + (-1)\cdot 24}$$

So the Bezout coefficients are $s = 1$ (for 32) and $t = -1$ (for 24).

Verification

$$(1)\cdot 32 + (-1)\cdot 24 = 32 - 24 = 8 \checkmark$$

Final Result

$$\gcd(24, 32) = 8 = (1)\cdot 32 + (-1)\cdot 24$$

Labelling the coefficients by which number they multiply gives $s = -1$ for 24 and $t = 1$ for 32, the same combination: $8 = 32 - 24$. The GCD result of $8$ is unchanged.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.