Recursion1.3

Recursion1.3 - End of Lecture CSE 2011 Prof J Elder 16 Last...

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

Last Updated 12-01-24 10:12 AM CSE 2011 Prof. J. Elder - 16 - End of Lecture Jan 19, 2012

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

View Full Document
Last Updated 12-01-24 10:12 AM CSE 2011 Prof. J. Elder - 17 - Given two integers, what is their greatest common divisor? e.g., gcd(56,24) = Example 3. The Greatest Common Divisor (GCD) Problem divides da 8 Notation: Given d , a ! ! : d | a ! " k # ! : a = kd Important Property: d | a and d | b ! d | ax + by ( ) " x , y # ! Note : All integers divide 0: d | 0 ! d " !
Last Updated 12-01-24 10:12 AM CSE 2011 Prof. J. Elder - 18 - Euclid’s Trick Claim: gcd( a , b ) = gcd( a ! kb , b ), k " ! . Important Property: d | a and d | b ! d | ax + by ( ) " x , y # ! Use this property to make the GCD problem ea Id s ea: ier! Euclid of Alexandria, "The Father of Geometry" c. 300 BC Proof: Let d = gcd( a , b ). Then d | a ! kb ( ) . Suppose d ! gcd( a " kb , b ). Then ! " d > d : " d | a # kb ( ) and " d | b . ! " d | a # Contradiction!

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

View Full Document
Last Updated 12-01-24 10:12 AM CSE 2011 Prof. J. Elder - 19 - Euclid’s Trick gcd( , ) gc 2 d( , ) ab a bb = gcd( , C ) gcd( , onseque : ) nce a bb = gcd( , ) gc 3 d( , ) a = . ., eg Use this property to make the GCD problem ea Id s ea:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

Recursion1.3 - End of Lecture CSE 2011 Prof J Elder 16 Last...

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

View Full Document
Ask a homework question - tutors are online