๐ Key idea of this section
GCF(big, small) = GCF(small, remainder). Repeat until the remainder is 0. Then run the steps BACKWARDS to write the GCF as a combination of the two numbers.
The fingerprint method has one weakness: you have to factor both numbers first. What if the numbers are big and stubborn? Enter one of the oldest algorithms on Earth โ and this time, we prove it before we use it.
Why it works (the proof)
Setup: divide a by b and write the result in the standard form
a = b ร q + r (q is the quotient, r is the remainder, 0 โค r < b)
Example to keep in view: 84 = 48 ร 1 + 36. Now the claim: GCF(a, b) = GCF(b, r). The proof uses the combination lemma from Lesson 4, in both directions:
- 1.Any common factor of b and r also divides b ร q + r (a combination of b and r).
- 2.But b ร q + r IS a. So every common factor of b and r divides a as well โ meaning every common factor of (b, r) is a common factor of (a, b).
- 3.Now the other direction. Solve the setup equation for r: r = a โ b ร q.
- 4.Any common factor of a and b also divides a โ b ร q (again a combination!), and that combination IS r. So every common factor of (a, b) is a common factor of (b, r).
- 5.Steps 2 and 4 say the two pairs have EXACTLY THE SAME common factors. If the lists are identical, their greatest members must match: GCF(a, b) = GCF(b, r). โ
And that's the whole algorithm: swap (big, small) for (small, remainder), repeat until the remainder hits 0, and the last nonzero remainder is the GCF.
The algorithm, flowing
84 = 48 ร 1 + 36 48 = 36 ร 1 + 12 36 = 12 ร 3 + 0 โ GCF(84, 48) = 12 โ
Three divisions, zero factoring. Fingerprint check: 84 = 2ยฒ ร 3 ร 7 and 48 = 2โด ร 3 โ shared 2ยฒ ร 3 = 12. Euclid agrees. โ
One more, bigger: GCF(252, 198).
252 = 198 ร 1 + 54 198 = 54 ร 3 + 36 54 = 36 ร 1 + 18 36 = 18 ร 2 + 0 โ GCF = 18 โ
Fingerprint check: 252 = 2ยฒ ร 3ยฒ ร 7 and 198 = 2 ร 3ยฒ ร 11 โ shared 2 ร 3ยฒ = 18. Two methods, one answer โ always reassuring.
The reverse gear: Bรฉzout's identity
Now for the honors superpower. Read the Euclid lines for (84, 48) BACKWARDS to express the GCF as a combination of 84 and 48:
12 = 48 โ 36 ร 1 from the middle line, solved for 12 = 48 โ (84 โ 48 ร 1) substitute 36 = 84 โ 48 ร 1 (top line) = 48 โ 84 + 48 distribute the minus sign = 2 ร 48 โ 1 ร 84 collect like terms
Check: 2 ร 48 โ 84 = 96 โ 84 = 12 โ
So 12 = 2ร48 + (โ1)ร84 โ the GCF is written as an integer COMBINATION of the two original numbers (negative coefficients allowed!). This fact is called Bรฉzout's identity: GCF(a, b) can always be written as mรa + nรb for some integers m and n. It looks like a party trick, but it's the beating heart of internet security: the codes that protect messages start by finding exactly these combinations, with Euclid's algorithm, on gigantic numbers.
A word from history
This procedure appeared in Euclid's book Elements around 300 BC โ over 2,300 years ago โ making it possibly the oldest algorithm still in daily use. Secure connections on the internet run versions of it every single day. Not bad for a geometry teacher from ancient Alexandria.
โ๏ธ Your Turn!
- 1.Use Euclid's algorithm to find GCF(90, 126). Show every line.
- 2.Now reverse it: write your answer as a combination m ร 90 + n ร 126.
๐ Show the answers
Answers:
- 1.126 = 90 ร 1 + 36; 90 = 36 ร 2 + 18; 36 = 18 ร 2 + 0 โ GCF = 18.
- 2.From the middle line: 18 = 90 โ 36 ร 2. From the top line: 36 = 126 โ 90 ร 1.
Substitute: 18 = 90 โ (126 โ 90) ร 2 = 90 โ 2ร126 + 2ร90 = 3ร90 โ 2ร126.
Check: 3ร90 โ 2ร126 = 270 โ 252 = 18 โ
(Fingerprint confirmation: 90 = 2 ร 3ยฒ ร 5 and 126 = 2 ร 3ยฒ ร 7 โ shared 2 ร 3ยฒ = 18.)