-1

So I'm currently trying to wrap my head around finding gcd through the Euclidean Algorithm in order to write the integers as a linear combination.

For example, a problem is to express the gcd(117,213) as a linear combination of these integers.

213 = 117 * 1 + 96

117 = 96 * 1 + 21

96 = 21 * 4 + 12

21 = 12 * 1 + 9

12 = 9 * 1 + 3

So gcd(117,213) = 3.

Going back, it's time to rewrite the equations as an expression of the remainder.

96 = 213 - 117

21 = 117 - 96

12 = 96 - 4 * 21

9 = 21 - 12

3 = 12 - 9

Then, as I understand it, you work your way up and substitute.

96 = 213 - 117

21 = 117 - (213 - 117) = -213 + 2 * 117

12 = (213 - 117) - 4 * (-213 + 2 * 117) = 5 * 213 - 9 * 117

9 = (-213 + 2 * 117) - (5 * 213 - 9 * 117) = -6 * 213 + 11 * 117

3 = (5 * 213 - 9 * 117) - (-6 * 213 + 11 * 117) = 11 * 213 - 20 * 117

My problem is, I don't understand how to simplify. Like in the step I bolded above, where the heck are the 5 and 9 coming from?

Bill Dubuque
  • 282,220
  • Just do it. You want $12 = a\color{blue}{213}+b\color{red}{117}$ and you have $12 = \color{orange}{96}- 4\cdot \color{green}{21}$. But we have $\color{orange}{96}=\color{blue}{213}-\color{red}{117}$ and $\color{green}{21}=-\color{blue}{213}+2\cdot\color{red}{117}$. What can we do. Well replace the $\color{orange}{96}$ and $\color{green}{21}$ to get: $12=[\color{blue}{213}-\color{red}{117}]-4[-\color{blue}{213}+2\cdot\color{red}{117}]$. Now we just simplify. $12=\color{blue}{213}[1+(-4)(-1)] + \color{red}{117}[-1+(-4)(2)]=\color{blue}{213}\cdot 5+\color{red}{117}\cdot[-9]$. That's all. – fleablood Jun 05 '24 at 23:50

1 Answers1

0

You have: 1) 1 copy of $213$ on the L.H parenthesis, just appearing as a $213$ , and $4$ copies of $213$ on the right parenthesis, appearing as $-213 (-4)$ (notice the two minueses cancel out in the product), for a total of $5$ copies of $213$. 2) For $117$ .Check something similar for the number of copies of 117 in the two parentheses.

gary
  • 4,167