0

I have been reviewing Bill Dubuque's explanation of a forward version of the extended Euclidean algorithm in another question. I have seen other explanations of this method on the internet, but Bill's explanation was the only one that gave a logical reason for the addition of extra variables, i.e., using matrix operations to keep "track of each remainder's expression as a linear combination of the gcd arguments."

Here is my question: Bill stops the process when the remainder is 1 or -1. Usually in the Euclidean algorithm, we don't stop until the remainder is zero, so we know that the gcd is the remainder of previous step. Is it merely that, being $\pm 1$, the next step must have a remainder of 0?

I also find it easier to write out the problem of, say gcd(141,19) in this way:

$ \begin{align} R1:& &1& &0& &|& &141& &141=& \; 7\cdot 19+8& \;\;\;\;\;\; R1-7R2 &\to R3& \\ R2:& &0& &1& &|& &19& &19=& \; 2\cdot 8+3& \;\;\;\;\;\; R2-2R3 &\to R4& \\ R3:& &1& &-7& &|& &8& &8=& \; 2\cdot 3+2& \;\;\;\;\;\; R3-2R4 &\to R5& \\ R4:& &-2& &15& &|& &3& &3=& \; 1\cdot 2+1& \;\;\;\;\;\; R4-R5 &\to R6& \\ R5:& &5& &-37& &|& &2& &2=& \; 2\cdot 1+0& \;\;\;\;\;\; R5-2R6 &\to R7& \\ R6:& &-7& &52& &|& &1& \\ R7:& &19& &-141& &|& &0& \end{align} $

So that the gcd(141, 19) = 1, and the linear combination of 141 and 19 to equal 1 is: $-7\cdot 141+52\cdot 19=1$.

Because I am still learning these methods, I prefer not to skip any steps. Otherwise, I think I understand the method.

  • 1
    This is the main all my posts link to, and it does include all the steps. Further it displays the calculation in (Hermite) row reduction form, which here is

    $$\left[ \begin{array}{r} -7 & 52\ 19 &!! -141\end{array}\right ] \left[ \begin{array}{r} 141 & 1 & 0\ 19 & 0 & 1\end{array}\right ] \ =\ \left[ \begin{array}{r} \color{#c00}1\ & \color{#c00}{-7}\ & \color{#c00}{52}\ \color{#0a0}0\ & \color{#0a0}{19}\ &!!! \color{#0a0}{-141}\end{array}\right] \qquad\qquad\qquad\qquad\qquad\qquad$$

    – Bill Dubuque Jun 26 '24 at 19:50
  • 1
    $\begin{align}\text{Notice row 1 is the $\ \ $ particular $\ \ $ solution }\ &\color{#c00}{1 =\ {-}7(141) ,+,52(19)}\ \text{Notice row 2 is the homogeneous solution }\ &\color{#0a0}{0 =,\ 19(141) -141(19)} \end{align}\ \ $ – Bill Dubuque Jun 26 '24 at 19:50
  • 1
    Generally we can stop when some remainder $,r_n,$ divides the prior $,r_{n-1},,$ say $,\color{#0af}{r_{n-1} = kr_n},,$ since then $,(r_1,r_2) = (\color{#0af}{r_{n-1}},r_n) = \color{#0af}{r_n}(\color{#0af}{k},1)=r_n,,$ and the final equation yields the Bezout identity $,\color{#c00}{r_n = a r_1 + b r_2} =,$ first row above. Usually we don't need the second $\rm\color{#0a0}{green}$ row corresponding to a final remainder $,r_{n+1} =\color{#0a0} 0.\ \ $ – Bill Dubuque Jun 26 '24 at 20:14
  • 1
    Note: I use the common notation $,(j,k) := \gcd(j,k),$ in the prior comment. $\ \ $ – Bill Dubuque Jun 26 '24 at 21:36

1 Answers1

0

Here is how it looks if you write the continued fraction for your ratio.... Note how the convergents give little 2 by 2 crossed products that are always $\pm 1. $ The pair $\frac{7}{1}, \frac{15}{2}$ gives $7 \cdot 2 - 15 \cdot 1 = -1. $ Next pair $ \frac{15}{2}, \frac{37}{5}$ gives $15 \cdot 5 - 37 \cdot 2 = 1. $ Next pair $ \frac{37}{5}, \frac{52}{7}$ gives $37 \cdot 7 - 52 \cdot 5 = -1. $ Finally $ \frac{52}{7}, \frac{141}{19}$ gives $52 \cdot 19 - 141 \cdot 7 = 1. $

$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

$$ \gcd( 141, 19 ) = ??? $$

$$ \frac{ 141 }{ 19 } = 7 + \frac{ 8 }{ 19 } $$ $$ \frac{ 19 }{ 8 } = 2 + \frac{ 3 }{ 8 } $$ $$ \frac{ 8 }{ 3 } = 2 + \frac{ 2 }{ 3 } $$ $$ \frac{ 3 }{ 2 } = 1 + \frac{ 1 }{ 2 } $$ $$ \frac{ 2 }{ 1 } = 2 + \frac{ 0 }{ 1 } $$ Simple continued fraction tableau:
$$ \begin{array}{cccccccccccc} & & 7 & & 2 & & 2 & & 1 & & 2 & \\ \frac{ 0 }{ 1 } & \frac{ 1 }{ 0 } & & \frac{ 7 }{ 1 } & & \frac{ 15 }{ 2 } & & \frac{ 37 }{ 5 } & & \frac{ 52 }{ 7 } & & \frac{ 141 }{ 19 } \end{array} $$ $$ $$ $$ 141 \cdot 7 - 19 \cdot 52 = -1 $$

$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

Will Jagy
  • 146,052
  • 1
    Please don't keep duplicating your prior CF answers ad infinitum. Instead you could have posted a comment linking to one of your prior answers, e.g. here. Not to mention this is not an answer to the question. – Bill Dubuque Jun 26 '24 at 19:57