Tom K. answered 08/06/20
Knowledgeable and Friendly Math and Statistics Tutor
Wikipedia is your friend, if your book isn't
We use the standard Euclidean algorithm, but we use the same calculation on two additional columns. We can label the three columns r, s, and t, where the first two rows of r are our two original numbers, the first two rows of s are 1 and 0 and the first two rows of t are 0 and 1.
Thus, our first two rows on 84x + 33y are
84 1 0
33 0 1
Then, in the next row, in the first column, we normally just put 84 (mod 33), or r3, but if we consider that r3 = r1 - r2q2, or q2 = int(r1/r2), or in general ri = ri-2 - ri-1qi-1, we shall use the same formula for s and t.
si = si-2 - si-1qi-1, ti = ti-2 - ti-1qi-1,
Our final values of s and t become the x and y values that solve 84x + 33y = gcd(84,33)
Note that once we have this solution, we have the general solution for 84x + 33y, as we just divide gcd(84,33) into the number and multiply this times our solution to the EEA solution.
Then, for this problem,
in row 3, r3 = r1 - r2q2, we get, as 84 (mod 33) = 18 and int(84/33) = 2
18 = 84 - 33 * 2
r3 = 18 and also q2 = 2
Then, we can now calculate s3 and t3
si = si-2 - si-1qi-1,
s3 = s1 - s2* q2
s3 = 1 - 0 * 2
s3 = 1
ti = ti-2 - ti-1qi-1,
t3 = t1 - t2* q2
t3 = 0 - 1 * 2
t3 = -2
We now have
84 1 0
33 0 1
18 1 -2
Then, in row 4,
as 33 (mod 18) = 15, and int(33/18) = 1
we have 15 = 33 - 18 * 1, so r4 = 15, q3 = 1, and
si = si-2 - si-1qi-1,
s4 = s2 - s3* q3
s4 = 0 - 1* 1 = -1
ti = ti-2 - ti-1qi-1,
t4 = t2 - t3* q3
t4 = 1 - (-2) * 1 = 3
84 1 0
33 0 1
18 1 -2
15 -1 3
Then, we keep going
84 1 0
33 0 1
18 1 -2
15 -1 3
3 2 -5
0
Then, from the next to last row, 3 = 2 * 84 - 5 * 33
Compute, and you will see that this is correct