Lesson 6

# Lesson 6 - GCD(3537 8739-2 3537 = GCD(3537 8739-7074 =...

This preview shows pages 1–2. Sign up to view the full content.

Greatest Common Divisor This algorithm has existed for the last 2000 years. When two things have GCD equal to 1, we say that they are relatively prime. Algorithm steps: 1. Write out GCD( a, b ) where a is bigger than b. 2. Divide a by b, getting remainder r. 3. Now the problem is to ﬁnd GCD( b, r ). 4. Repeat steps 2 and 3 until r is 1 or 0. 5. If r is 1, then 1 is the greatest common divisor, and if r is 0 than the previous remainder is the greatest common divisor. NOTE: For poly- nomials, the algorithm stops for any constant remainder. Also, we can always rewrite any polynomial by multiplying it by any non-zero number. Examples Example 1: Find the greatest common divisor of 29753 and 8739. GCD(29754 , 8739) = GCD(8739 , 29754 - 3 * 8739) = GCD(8739 , 29754 - 26217) = GCD(8739 , 3537) =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: GCD(3537 , 8739-2 * 3537) = GCD(3537 , 8739-7074) = GCD(3537 , 1665) = GCD(1665 , 3537-2 * 1665) = GCD(1665 , 3537-3330) = GCD(1665 , 207) = GCD(202 , 1665-8 * 207) = GCD(202 , 1665-1656) = GCD(207 , 9) = GCD(9 , 207-23 * 9) = GCD(9 , 0) = 9 So the GCD of 29753 and 8739 is 9. Example 2: Find the greatest common divisor of-2 x 2 + 5 x-12 x + 2 x + 1 and x 2-3 x + 5 GCD(-2 x 2 + 5 x-12 x + 2 x + 1 , x 2-3 x + 5) 3-5-2 5-12 2 1 ↓-6-3-15 ↓ 10 5 25-2-1-5-8 26 GCD( x 2-3 x + 5 ,-8 x + 26) GCD( x 2-3 x + 5 , x-13 / 4) 13 / 4 1-3 5 ↓ 13 / 4 13 / 16 1 1 / 4 93 / 16 GCD( x-13 / 4 , 93 / 16) Since 93/16 is a constant, we say that the GCD is 1. So the two polyno-mials are relatively prime....
View Full Document

## This note was uploaded on 03/22/2010 for the course MATH 1104 taught by Professor Unknown during the Fall '10 term at Carleton.

### Page1 / 2

Lesson 6 - GCD(3537 8739-2 3537 = GCD(3537 8739-7074 =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online