0% found this document useful (0 votes)
28 views8 pages

Greatest Common Divisor

Uploaded by

bellenjamaica
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views8 pages

Greatest Common Divisor

Uploaded by

bellenjamaica
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Module 2: Theory of Divisibility in Integers

Lesson 4 : Greatest Common Divisor and


Euclidian Algorithm

Math is Fun!

Who is Euclid?

https://medium.com/@sunfa
ceman/math-and-magic-
euclid-defines-space-
ea987f61709c
The Greek mathematician Euclid lived and flourished in Alexandria in Egypt around 300
BCE, during the reign of Ptolemy I. Almost nothing is known of his life, and no likeness or
first-hand description of his physical appearance has survived antiquity, and so depictions of
him (with a long flowing beard and cloth cap) in works of art are necessarily the products of
the artist’s imagination.
He probably studied for a time at Plato’s Academy in Athens but, by Euclid’s time,
Alexandria, under the patronage of the Ptolemies and with its prestigious and
comprehensive Library, had already become a worthy rival to the great Academy.
Euclid is often referred to as the “Father of Geometry”, and he wrote perhaps the most
important and successful mathematical textbook of all time, the “Stoicheion” or “Elements”,
which represents the culmination of the mathematical revolution which had taken place in
Greece up to that time. He also wrote works on the division of geometrical figures into into
parts in given ratios, on catoptrics (the mathematical theory of mirrors and reflection), and
on spherical astronomy (the determination of the location of objects on the “celestial
sphere”), as well as important texts on optics and music.
The “Elements” remained the definitive textbook on geometry and mathematics for
well over two millennia, surviving the eclipse in classical learning in Europe during the Dark
Ages through Arabic translations. It set, for all time, the model for mathematical argument,
following logical deductions from inital assumptions (which Euclid called “axioms” and
“postulates”) in order to establish proven theorems.
The “Elements” also includes a series of theorems on the properties of numbers and
integers, marking the first real beginnings of number theory. For example, Euclid proved
what has become known as the Fundamental Theorem of Arithmethic (or the Unique
Factorization Theorem). He was the first to realize – and prove – that there are infinitely
many prime numbers. The basis of his proof, often known as Euclid’s Theorem, is that, for
any given (finite) set of primes, if you multiply all of them together and then add one, then a
new prime has been added to the set (for example, 2 x 3 x 5 = 30, and 30 + 1 = 31, a prime
number) a process which can be repeated indefinitely.
Euclid also identified the first four “perfect numbers”, numbers that are the sum of all their
divisors (excluding the number itself):
6 = 1 + 2 + 3;
28 = 1 + 2 + 4 + 7 + 14;
496 = 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248; and
8,128 = 2 + 4 + 8 + 16 + 32 + 64 + 127 + 254 + 508 + 1,016 + 2,032 + 4,064.
Introduction

You have learned in your elementary mathematics how to find the Greatest
Common Divisor (GCD) or commonly known as Greatest Common Factor (GCF) for
relatively small numbers. To find it, you will just apply prime factorization to
determine all the positive divisors or factors of two numbers and finally choose the
greatest or the largest divisor or factor common to each number. However, this
method would be time-consuming and tiresome when you deal with large numbers.
Don’t worry a mathematician solved that problem by developing an algorithm or a
systematic method which was named after him- the Euclidian algorithm. In this
lesson, you will learn how to apply this algorithm in finding the Greatest Common
Divisor of large numbers.

Objectives

1. State the basis of Euclidian algorithm in finding the Greatest Common Divisor
(GCD); and
2. Apply the Euclidian algorithm to determine the Greatest Common Divisor (GCD).

Suggested Learning Time 1 hour and 30 minutes to 2 hours

Let’s Try Answering This!

Find gcd (a, b) using the Euclidean Algorithm for each of the values below:

(1) a = 37, b = 60

(2) a = 803, b = 154


(3) a = 793, b = 3172

(4) a = 25174, b = 42722

Let’s Study This!

Let’s first review briefly what do we mean by Greatest Common Divisor.

“The greatest common divisor of two numbers a and b (not both zero) is the largest
number that divides both of them. It is denoted by gcd (a, b). If gcd (a, b) = 1, we say
that a and b are relatively prime.”
Note: gcd stands for greatest common divisor

Let’s have two examples of finding GCD using the method your are very familiar
with - prime factorization.

Find gcd (12, 20).

12 20

4 3 4 5

2 2 2 2

22, 3 22, 5

Using factor tree method, 12 has 22 and 3 and 20 has 22 and 5 as its prime
factors. To find the GCD, we choose the greatest or largest divisor common to 12
and 20. In this case, its 4. Therefore, gcd(12, 20) = 4.

Using factorization in finding the GCD may seem easy and efficient but for large
numbers, it would not be that efficient.
The most efficient method known for finding the greatest common divisors of
two numbers especially large numbers is called the Euclidean algorithm. It consists
of doing a sequence of divisions with remainder until the remainder is zero.
Let’s see how to do it.
Example 1: Find gcd(36, 132).
Step 1: Divide 132 by 36. This will give us a quotient of 3 and a remainder of 24.
We write this as 132 = 3 x 36 + 24.
Step 2: Take 36 and divide it by the remainder 24 from the previous step.This
gives 36 = 1 x 24 + 12.
Step 3: Divide 24 by 12, and we find a remainder of 0, like this 24 = 2 x 12 + 0.
“The Euclidean algorithm says that as soon as you get a remainder of 0, the
remainder from the previous step is the greatest common divisor of the original two
numbers. So in this case we find that gcd (132, 36) = 12.”

Let’s have a larger example. Find gcd (1160718174,316258250).


Study the calculations below using Euclidian algorithm.

We begin by dividing 1160718174 by 316258250, which gives 3 with a


remainder of 211943424. Next we take 316258250 and divide it by 211943424. This
process continues until we get a remainder of 0.
Notice how at each step we divide a number A by a number B to get a quotient
Q and a remainder R. In other words,
A = Q x B+R
Then at the next step we replace our old A and B with the numbers B and R and
continue the process until we get a remainder of 0. At that point, the remainder R
from the previous step is the greatest common divisor of our original two numbers.
So the above calculation shows that gcd (1160718174, 316258250) = 1078.
We can partly check our calculation (always a good idea) by verifying that 1078
is indeed a common divisor. Thus,
1160718174 = 1078 x 1076733 and 316258250 = 1078 x 293375.
If we are given A and B, how can we find the quotient Q and the remainder R?
Of course, you can always use long division, but that can be time consuming and
subject to arithmetic errors if A and B are large. A pleasant alternative is to find a
calculator or computer program that will automatically compute Q and R for you.
However, even if you are only equipped with an inexpensive calculator, there is an
easy three-step method to find Q and R.
Method to Compute Q and R on a Calculator so that A = B x Q + R
1. Use the calculator to divide A by B. You get a number with decimals.
2. Discard all the digits to the right of the decimal point. This gives Q.
3. To find R, use the formula R = A - B x Q.
For example, suppose that A = 12345 and B = 417. Then A/B = 29.6043…,
so Q = 29 and R = 12345 - 417 · 29 = 252.

Let’s Apply This!

Use the Euclidean algorithm to compute each of the following gcd's.

(1) gcd (377, 233)

(2) gcd(12345,67890)
(3) gcd (54321,9876)

Let’s Test Your Understanding!

Use the Euclidean algorithm to compute the following:

(1) gcd (4567; 91837)


(2) gcd(1583890; 3927).

(3)gcd (4567, 91837)


(4) gcd (1583890, 3927)

Useful References:

Burton, D.M. (2007). Elementary number theory (6th ed.) The McGraw-Hill
Companies, Inc.

Clark, W.E. (2003) Elementary number theory (1st ed.) Department of


Mathematics. University of South Florida.

Rosen, K.H. (1986) Elementary number theory and its applications. Addison -
Wesley Publishing Company.

Silverman, J.H. (2012) A friendly introduction to elementary number theory (4th


ed.) Pearson Education, Inc.

The Story of Mathematics (n.d.) Euclid of Alexandria – the father of geometry.


https://www.storyofmathematics.com/hellenistic_euclid.html

You might also like