I am studying for my NES mathematics endorsement exam and am working through a problem which deals with the Euclidean Algorithm to find the GCD of two relatively prime numbers. Then, I need to find some s such that 200s +567t = 1. The method I am using to find s is the "backwards" Euclidean Algorithm.
I need some help with understanding how the terms are being collected. In one tutorial, the gcd (175, 77) is found:
175 = 2(77) + 21 (a)
77 = 3(21) + 14 (b)
21 = 1(14) + 7 (c)
14 = 2( 7) + 0
Starting with (c), we go backwards:
7 = 21 - 1(14)
14 = 77 - 3(21)
21 = 175 - 2(77)
7 = 21 - 1(14)
7 = 21 - 1(77 - 3(21)) *plugging (b) into (c)
7 = - 1(77) + 4(21) *collect terms
7 = - 1(77) + 4(175 - 2(77)) *plugging (a) in
7 = 4(175) + (-9)(77) *collecting terms again
The steps where they collect terms is where I am lost. I don't understand how the +4(21) comes to be when compared to the -9(77). I can figure out how the second collection comes to be with -1 + (-4)(2) = -9 but not the first. Is there an imaginary "1" at the front?
7 = 1(21) - 1(77 - 3(21)) *plugging (b) into (c)
So then it would be 1 + (-1)(-3)?
If I can figure this collection thing out, I should be able to finish working out the problem I was assigned on my own.
Given $ 7 = 21 - 1(77 - 3(21)) $
you want to know how to get $7 = - 1(77) + 4(21) $.
You are correct that we write $21$ as $1*21$.
Now when we distribute the $-1$, we get $$7 = 1*21 - 1*77 -1*(-3)*21=1*21 - 1*77 +3*21.$$
Collect like terms to get $7 = - 1(77) + 4(21) $.
We just used the distributive property $a*(b + c) = ab * ac$ twice: first with $a=-1$, $b=77$, and $c=-3(21)$, then again backwards with $a=21$, $b=1$, and $c= 3$.
Similarly, given $ 7 = - 1(77) + 4(175 - 2(77))$, start by distributing the $4$, then collect the terms with 77 in them.