You are on page 1of 6

Euclidean Algorithm Presentation

Yiren Zhou
December 8, 2021

I am Yiren Zhou, a second year Mathematics and Computer Science


student. Today I want to present a simple yet fundamental conclu-
sion from basic number theory: Euclidean Algorithm. The algorithm
is used to find the greatest common divisor of 2 arbitrary integer.
Definition: An integer b is divisible by x if there exists an integer a
such that ax = b, denoted as x|b, reads as x divides b.
Definition: An integer x is a common divisor of integer b, c means
x|b and x|c. The greatest common divisor of b, c is the greatest
among all common divisors, denoted gcd(b, c)
Definition: A linear combination of a, b is ax + by for arbitrary
integer x, y
Euclidean Algorithm: For arbitrary two integers a and b, the way
to find their greatest common divisor is to divide them against each
other. Say a > b, then take a/b = q...r, or can be written as a =
bq + r where q is the quotient and r is the remainder. If r is not 0,
then we continue to find the greatest common divisor of b(divisor) and
r(remainder) (then start from beginning).
1
After finitely many operations, the remainder would be 0, and our last
divisor is the greatest common divisor of our original a, b!
Citation: An Introduction to the Theory of Numbers by Ivan Niven,
Herbert S. Zuckerman, Hugh L. Montgomery

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

r = b − ql = b − q(ax0 + by0) = a(x0q) + b(qy0 − 1)

This is of the form ax + by where x, y are integers, so r is in S and


0 < r < l, contradiction to l is the smallest positive element from S!
Thus l must divide a and b, l is a common divisor of a and b.

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

d = ax0 + by0 = ax0 − axy0 + axy0 + by0 = a(x0 − xy0) + (b + ax)y0

From the representation above, we know that d is not only a linear


combination of a, b(d = ax0 + by0), but also a linear combination of
a, b + ax(d = a(x0 − xy0) + (b + ax)y0)!
In our proof above, we know that gcd(a, b) is the smallest possible in-
teger value of all possible ay + bz for arbitrary integer y, z, so we see
d ≥ g because d is just any linear combination of a and b + ax, but g
is the greatest common divisor of them.
Want to prove d ≤ g in order to conclude d = g. d is a common
divisor of a and b, by definition there exists integers A, B such that
a = Ad and b = Bd, so

b + ax = Bd + Adx = d(B + Ax)

This is still a multiple of d! So d|(b + ax), so d is a common divisor of


a and b + ax, thus d <= g because g is the greatest common divisor

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!

You might also like