Professional Documents
Culture Documents
Yiren Zhou
December 8, 2021
2
3
You’ll notice, this algorithm finds out the greatest common divisor re-
ally fast given we are looking at huge numbers (and the second exam-
ple is pretty much a worst case situation). In fact, it only takes a few
steps (3-5) to calculate integers we daily use.
Sketch of proof: Need to prove gcd(a, b)=gcd(a, b+ax) for arbitrary in-
teger a, b, x. From this we can see the quotienting and taking remain-
der algorithm preserves gcd! That is because we say b + ax divide by a,
we see the quotient would be x and remainder would be b, thus prov-
ing this statement proves quotienting preserves gcd.
In order to prove that, we first need to prove that for arbitrary integers
a and b, there exists integers x, y such that gcd(a, b) = ax + by!
Consider S = {ax + by : x, y ∈ Z}
This is the same as saying that S is all possible linear combination
value of a, b.
Because integers are well-ordered, we may pick out the smallest posi-
tive integer from this set. Denote it as l = ax0 + by0.
Want to prove l|a and l|b by contradiction.
Assume l do not divide b, then b is not a multiple of l, by our normal
division, we know b = ql + r where q, r is integer, q is the quotient and
r is the remainder and 0 < r < l. Reformat the equation and plug in
the definition of l = ax0 + by0
4
Let g be gcd(a, b), want to prove g = l. By definition, g|a and g|b, so
there exists integers A, B such that a = gA, b = gB. l = ax0 + by0 =
gAx0 + gBy0 = g(Ax0 + By0), so l is an integer multiple of g, meaning
g ≤ l because g, l are both positive, and thus the integer in the paren-
thesis must be ≥ 1. However, g is the greatest common divisor, and l
is a common divisor, so l ≤ g, these 2 conditions together means g = l!
So now we have proved there exists ax + by = gcd(a, b)!
Finally, I want to prove gcd(a, b)=gcd(a, b + ax) for arbitrary x. De-
note gcd(a, b) = d and gcd(a, b + ax) = g. By what we just proved,
there exists x0, y0 such that
5
of those two! We have d = g, that is gcd(a, b)=gcd(a, b + ax), and we
have proven Euclidean Algorithm would work properly to calculate the
greatest common divisor efficiently.
That’s it for my presentation, thank you for reading!