0

I know the extended euclidean algorithm by working myself backward from the euclidean algorithm to find the GCD. I'm confused with the extended euclidean algorithm as given in this page. How is this process derived and why are we introducing new variables s and t? How is this process derived from working backwards with the standard euclidean algorithm? And how does the computation work now that we have $s_0, s_1, t_0, t_1$, which is neither intuitive nor any explanation is given anywhere.

1 Answers1

1

This is not very hard, but it indeed requires some explanations.

What is easy to prove by induction (of order $2$) is this:

In the Euclidean algorithm for the g.c.d. of two positive integers $a$ and $b$, denote $q_i$ and $r_i$ the quotient and the remainder in the $i$-th Euclidean division. Then all remainders satisfy a Bézout's relation: $$r_i=s_ia+t_i b\qquad(s_i, t_i\in\mathbf Z).$$

Indeed the first division: $\;b=q_1a+r_1$ can be read as $r_1=b-q_1a$ (supposing $b>a$). The second division: $\;a=q_2 r_1+r_2$ yields $$ r_2=a-q_2r_1=a-q_2(b-q_1a)=(1+q_1q_2)a -q_2b. $$

Suppose now the assertion is true for $r_{i-1}$ and $r_i\;(i>2)$. From the equalities \begin{align} r_{i-1}&=q_ir_i+ r_{i+1}, \\ r_{i-1}&=s_{i-1}a+t_{i-1}b, \\ r_i&=s_ia+t_ib, \end{align} we deduce that $$r_{i+1}=(s_{i-1}-q_is_i)a+(r_{i-1}-q_irs_i)b$$ whence the recursive relations of the extended Euclidean algorithm:

Initialisation (coefficients for $a$ and $b$): $$b:\quad (0,1),\qquad a:\quad (1,0)$$ $$\text{Recurrence relations: }\qquad s_{i+1}=s_{i-1}-q_is_i,\qquad t_{i+1}=t_{i-1}-q_it_i\hspace{12em}$$

Bernard
  • 175,478
  • if $r_i=s_ia+t_ib$ then how does $r_{i-1}=q_i r_i+r_{i+1} \implies\ r_{i-1}=s_{i-1}a+t_{i-1}b$ ? – mathmaniage Mar 06 '19 at 16:02
  • The conclusion of your implication is part of the inductive hypothesis (I use a recursion of order $2$ – I should have been more explicit). – Bernard Mar 06 '19 at 16:08
  • I don't know about recursion or anything like that, should I study something else before understanding this? – mathmaniage Mar 06 '19 at 16:11
  • You've never seen a proof by induction? – Bernard Mar 06 '19 at 16:14
  • I have, but the recursion of order 2 is what I meant I didn't understand. – mathmaniage Mar 06 '19 at 16:15
  • This happens when establishing a case requires it is supposed true for the two previous cases. This requires initialising for the first two cases. It's a form of strong induction. – Bernard Mar 06 '19 at 16:21