The Euclidean Algorithm



Similar documents
MATH 13150: Freshman Seminar Unit 10

Previously, you learned the names of the parts of a multiplication problem. 1. a. 6 2 = 12 6 and 2 are the. b. 12 is the

Factoring Whole Numbers

Section 4.2: The Division Algorithm and Greatest Common Divisors

Introduction to Fractions

Adding and Subtracting Fractions. 1. The denominator of a fraction names the fraction. It tells you how many equal parts something is divided into.

3.1. RATIONAL EXPRESSIONS

Prime Factorization, Greatest Common Factor (GCF), and Least Common Multiple (LCM)

Warm-Up ( 454 3) 2 ( ) 3

Grade 6 Math Circles March 10/11, 2015 Prime Time Solutions

17 Greatest Common Factors and Least Common Multiples

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

INTRODUCTION TO FRACTIONS

Grade 7/8 Math Circles Fall 2012 Factors and Primes

Greatest Common Factor and Least Common Multiple

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

8 Primes and Modular Arithmetic

Pre-Calculus II Factoring and Operations on Polynomials

Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II

A Prime Investigation with 7, 11, and 13

Lesson 4. Factors and Multiples. Objectives

FRACTIONS MODULE Part I

s = s = s =

PREPARATION FOR MATH TESTING at CityLab Academy

8 Divisibility and prime numbers

Introduction to Fractions, Equivalent and Simplifying (1-2 days)

Recall the process used for adding decimal numbers. 1. Place the numbers to be added in vertical format, aligning the decimal points.

SIMPLIFYING ALGEBRAIC FRACTIONS

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

3 cups ¾ ½ ¼ 2 cups ¾ ½ ¼. 1 cup ¾ ½ ¼. 1 cup. 1 cup ¾ ½ ¼ ¾ ½ ¼. 1 cup. 1 cup ¾ ½ ¼ ¾ ½ ¼

Today s Topics. Primes & Greatest Common Divisors

An Introduction to Number Theory Prime Numbers and Their Applications.

Introduction to Programming (in C++) Loops. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC

Example. Introduction to Programming (in C++) Loops. The while statement. Write the numbers 1 N. Assume the following specification:

Section 4.1 Rules of Exponents

Math Workshop October 2010 Fractions and Repeating Decimals

Chapter 11 Number Theory

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Grade 7 & 8 Math Circles October 19, 2011 Prime Numbers

Decimal Notations for Fractions Number and Operations Fractions /4.NF

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Stupid Divisibility Tricks

GREATEST COMMON DIVISOR

Prime Factorization 0.1. Overcoming Math Anxiety

Computation Strategies for Basic Number Facts +, -, x,

GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014!

Paramedic Program Pre-Admission Mathematics Test Study Guide

Playing with Numbers

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

Pre-Algebra Lecture 6

Fractions to decimals

How do you compare numbers? On a number line, larger numbers are to the right and smaller numbers are to the left.

1.2 Linear Equations and Rational Equations

The GMAT Guru. Prime Factorization: Theory and Practice

Session 6 Number Theory

Converting from Fractions to Decimals

north seattle community college

Activity 1: Using base ten blocks to model operations on decimals

Student Worksheet 1 TI-15 Explorer : Finding Patterns

MULTIPLICATION AND DIVISION OF REAL NUMBERS In this section we will complete the study of the four basic operations with real numbers.

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

Multiplying and Dividing Fractions

V Quantitative Reasoning: Computers, Number Theory and Cryptography

Sequential Skills. Strands and Major Topics

Prime Time: Homework Examples from ACE

Math 319 Problem Set #3 Solution 21 February 2002

Cubes and Cube Roots

Greatest Common Factors and Least Common Multiples with Venn Diagrams

2.3 Solving Equations Containing Fractions and Decimals

3.4 Multiplication and Division of Rational Numbers

When factoring, we look for greatest common factor of each term and reverse the distributive property and take out the GCF.

POLYNOMIAL FUNCTIONS

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Negative Integer Exponents

FRACTION WORKSHOP. Example: Equivalent Fractions fractions that have the same numerical value even if they appear to be different.

Session 7 Fractions and Decimals

The last three chapters introduced three major proof techniques: direct,

1.6 The Order of Operations

of Nebraska - Lincoln

6.1 The Greatest Common Factor; Factoring by Grouping

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

A Short Guide to Significant Figures

Math Circle Beginners Group October 18, 2015

Homework until Test #2

Computer Science 281 Binary and Hexadecimal Review

Fibonacci Numbers and Greatest Common Divisors. The Finonacci numbers are the numbers in the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,...

Continued Fractions and the Euclidean Algorithm

2.4 Real Zeros of Polynomial Functions

Decimals and other fractions

Solve addition and subtraction word problems, and add and subtract within 10, e.g., by using objects or drawings to represent the problem.

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Grade 6 Math Circles. Binary and Beyond

YOU MUST BE ABLE TO DO THE FOLLOWING PROBLEMS WITHOUT A CALCULATOR!

Solution Guide Chapter 14 Mixing Fractions, Decimals, and Percents Together

Solving Rational Equations

Lesson on Repeating and Terminating Decimals. Dana T. Johnson 6/03 College of William and Mary

QM0113 BASIC MATHEMATICS I (ADDITION, SUBTRACTION, MULTIPLICATION, AND DIVISION)

Common Multiples. List the multiples of 3. The multiples of 3 are 3 1, 3 2, 3 3, 3 4,...

5544 = = = Now we have to find a divisor of 693. We can try 3, and 693 = 3 231,and we keep dividing by 3 to get: 1

Transcription:

The Euclidean Algorithm A METHOD FOR FINDING THE GREATEST COMMON DIVISOR FOR TWO LARGE NUMBERS To be successful using this method you have got to know how to divide. If this is something that you have not done in a while and have forgotten or have never really mastered and have relied on the use of a calculator instead, you will first want to review the Long Division algorithm. Presented here is one example: 3846 153 The Algorithm for Long Division Step 1: Divide Step 2: Multiply quotient by divisor Step 3: Subtract result Step 4: Bring down the next digit Step 5: Repeat When there are no more digits to bring down, the final difference is the remainder. This can be rewritten in the form of what is known as the Division Algorithm (although it is not an algorithm): 3846 = 153 25 + 21 (dividend equals divisor times quotient plus remainder) (note that 0 remainder divisor) If you need more help with long division, go to You Tube and search long division. Work through several examples and make sure you can successfully perform each example viewed on your own. The greatest common divisor (gcd) of two integers, a and b, is the largest integer that divides evenly into both a and b. We write gcd(a, b). There are three methods for finding the greatest common factor. Page 1 of 5

Method #1 The easy method: Inspection This involves two numbers that, through experience, are easily grasped, such as 12 and 18. Start with the smaller of the two numbers, 12. Does this divide into both numbers? (No, it does not divide evenly into 18.) Since 12 didn t work, try the next largest integer that evenly divides 12 by inspection that number is easily found to be 6. Does 6 Now you try some: also divide 18? Yes, therefore we are done we have found the greatest (a) gcd(24, 54) common divisor and it is 6, (b) gcd(18, 42) hence, gcd(12, 18) = 6. Find the greatest common divisor of each by inspection. Method #2 Prime Factorization Method The first step is to break each number into its prime factorization, then discern all the factors the two numbers have in common. Multiply these together. The result is the greatest common divisor. Example 1: Find the gcd(168, 180) 168 = 2 3 3 7 = 2 2 2 3 7 180 = 2 2 3 2 5 = 2 2 3 3 5 The common factors are 2 2 3 = 12, therefore gcf(168, 180) = 12. Example 2: Find the gcd(220, 1323) 220 = 2 2 5 11 189 = 3 3 7 Now you try some: Find the greatest common divisor of each by first finding the prime factorization of each number. (c) gcd(244, 354) (d) gcd(128, 423) Page 2 of 5

Observe that these two numbers have no common factors. So in this case the gcd(220, 1323) = 1 and we say that the two integers are relatively prime. Method #3 The Euclidean Algorithm This method asks you to perform successive division, first of the smaller of the two numbers into the larger, followed by the resulting remainder divided into the divisor of each division until the remainder is equal to zero. At that point, look at the remainder of the previous division that will be the greatest common divisor. Example: Find the gcd(1424, 3084) WORK SPACE: PRESENTATION: 3084 = 1424 2 + 236 1424 = 236 6 + 8 236 = 8 29 + 4 8 = 4 2 + 0 Hence the gcd(1424, 3084) = 4 Now you try some: Note: Gabriel Lamé (1795-1870) found that the number of steps required in the Euclidean Algorithm 4 Find the greatest common divisor of each by first finding the prime factorization of each number. (e) gcd(2415, 3289) (f) gcd(4278, 8602) (g) gcd(406, 555) Page 3 of 5

is at most 5 times the number of digits in the smaller number. Why does the Euclidean Algorithm work? The example used to find the gcd(1424, 3084) will be used to provide an idea as to why the Euclidean Algorithm works. Let d represent the greatest common divisor. Since this number represents the largest divisor that evenly divides both numbers, it is obvious that d 1424 and d 3084. Hence d 3084 1424 in the same way that a numerator of two or more terms is divisible by a factor in the denominator if and only if that factor divides evenly into each individual term in the numerator. Furthermore d 3084 2(1424) or, simplifying the left side, d 236. Consequently we note that d divides the remainder resulting from the division of the two numbers for which the greatest common factor is being sought. This corresponds to the first long division calculated in the example above. The problem has now been reduced to a smaller one. We have that d 1424 and d 236. Hence d 1424 236, or better yet, d 1424 6(236) which when simplified reveals that d 8. At this point we know that d must be one of the following values: 1, 2, 4, or 8. Note that 8 is the remainder resulting from the division of the divisor and remainder found in the original division, so it will not be a divisor of both. So we will take the divisor and remainder from the second division to reduce the problem to yet an even smaller one. Now we know that d 236 and d 8, so d 236 8 or d 236 29(8), which leaves us, after calculation, with the fact that d 4. This, of course, corresponds to the third long division performed above. One last long division reduces the problem one more level the final level. We have that d 8 and d 4, hence d 8-2(4) or d 0. We can go no further. d 0 does not provide us with any useful information. (Why not?) But d 4, where 4 is seen to be the remainder of the last long division, tells us that d can be 1, 2, or 4. The largest amongst these is 4 so d must be equal to 4 and we are done. We have thus discovered that d which equals the gcd(1424, 2084) is equal to 4. Page 4 of 5

Now you try some: Answers (a) gcd(24, 54) = 6 (b) gcd(18, 42) = 6 (c) gcd(244, 354) = 2 (d) gcd(128, 423) = 1 (e) gcd(2415, 3289) = 23 (f) gcd(4278, 8602) = 46 (g) gcd(406, 555) = 1 Page 5 of 5