We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
6110123, 1052 PM Euclidean algorithm
Supplementary material for the
lecture of Monday, July 12
‘The Euclidean algorithm
‘The Euclidean algorithm is a way to find the greatest common divisor of two positive integers, a and b. First let
me show the computations for a=210 and b=45.
Divide 210 by 45, and get the result 4 with remainder 30, so 210=4-45+30,
Divide 45 by 30, and get the result | with remainder 15, so 45=1-30+15.
Divide 30 by 15, and get the result 2 with remainder 0, so 30=2-15+0.
The greatest common divisor of 210 and 45 is 15.
Let's see. Several questions occur immediately..
1, What's going on here?
2. Why does the algorithm stop?
3. Why is the answer correct?
OK. I will answer first question by giving a formal description of the algorithm, which supposedly finds the
greatest common divisor (GCD) of two integers. This "greatest common divisor" must exist, since positive
integer divisors of integers can't be any larger than the integers:
Formal description of the Euclidean algorithm
+ Input Two positive integers, a and b.
+ Output The greatest common divisor, g, of and b,
+ Internal computation
1. Ifa