Using Euclid's Algorithm
- 20 = 1 × 12 + 8
⇒ 8 = 20 - 1 × 12
- 12 = 1 × 8 + 4
⇒ 4 = 12 - 1 × 8
- 8 = 2 × 4 + 0
⇒ GCF(12, 20) = 4
12x + 20y = 4: Find x and y
Reversing Euclid's Algorithm
- 4 = 12 - 8
- 4 = 12 - (20 - 12)
= 2 × 12 - 20
x = 2 and y = -1
2 × 12 - 20 = 4
Alternative
(2 × 12 - 20) - (5 × 12 - 3 × 20) = 4
-3 × 12 + 2 × 20 = 4
x = -3 and y = 2
-3 × 12 + 2 × 20 = 4