next up previous
Next: Up: Previous:

Correctness of Extended-Euclid

d' = gcd(b, a mod b)
= bx' + (a mod b)y'
$\;\;\;\;\;$; Euclid's Theorem
= d = gcd(a, b)
$\;\;\;\;\;$; Euclid's Algorithm

d = bx' + (a - $\lfloor$ \(\frac{a}{b}\)$\rfloor$b) y' $\;\;\;\;\;$; Division Theorem
= ay' + b(x' -
$\lfloor$ \(\frac{a}{b}\)$\rfloor$y') $\;\;\;\;\;$; Rearrange terms


d = d' = ax + by
x = y'
y = x' -
$\lfloor$ \(\frac{a}{b}\)$\rfloor$y'



next up previous
Next: Up: Previous: