1 / 3

Divisors and GCD’s (2/5)

Divisors and GCD’s (2/5). For the record: Definition. We say a number d divides an integer n if there exists an integer k such that n = k d . In standard language, d “divides evenly” into n . The remainder r is 0.

caine
Download Presentation

Divisors and GCD’s (2/5)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Divisors and GCD’s (2/5) • For the record: Definition. We say a number ddivides an integer n if there exists an integer k such that n = k d . • In standard language, d “divides evenly” into n. The remainder r is 0. • We write d | n. This reads “d divides n”, i.e., “|” is a verb. • Definition. If n and m are integers, then the greatest common divisor d of n and mis the largest number which divides both n and m. • We write d = GCD(n, m). • Finally, if GCD(n, m) = 1, we say n and m are relatively prime.

  2. How can you compute a GCD? • Worst way: Write down all the divisors of n and all the divisors of m and pick out the largest number which occurs on both lists. • Better way: Factor n and m into primes. The GCD will be all the primes that occur in both representations. (Problem: Factorization can be hard to do.) • Best way: The Euclidean Algorithm! This is repeated divisions as illustrated in the text and in class. • Example: Try to compute GCD(78, 585) with each of these methods.

  3. About the EA (Euclidean Algorithm) • One can see that it produces a common divisor by running it backwards. • One can see that it produces the greatest common divisor by running it forwards. • One can see that it must terminate (i.e., reach a remainder of 0) since every remainder is positive and smaller than the previous remainder. • For Friday: • Hand-in #1 is due. • Read Chapter 5 and do Exercise 5.1, but also do them by the factorization method.

More Related