discrete mathematics mathematical reasoning primes and
play

Discrete Mathematics & Mathematical Reasoning Primes and - PowerPoint PPT Presentation

Discrete Mathematics & Mathematical Reasoning Primes and Greatest Common Divisors Colin Stirling Informatics Some slides based on ones by Myrto Arapinis Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 1 / 12 Primes


  1. Discrete Mathematics & Mathematical Reasoning Primes and Greatest Common Divisors Colin Stirling Informatics Some slides based on ones by Myrto Arapinis Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 1 / 12

  2. Primes Definition A positive integer p > 1 is called prime iff the only positive factors of p are 1 and p . Otherwise it is called composite Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 2 / 12

  3. Primes Definition A positive integer p > 1 is called prime iff the only positive factors of p are 1 and p . Otherwise it is called composite Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 2 / 12

  4. Primes Definition A positive integer p > 1 is called prime iff the only positive factors of p are 1 and p . Otherwise it is called composite Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size 765 = 3 · 3 · 5 · 17 = 3 2 · 5 · 17 Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 2 / 12

  5. Proof of fundamental theorem Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 3 / 12

  6. Proof of fundamental theorem Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Showed by induction if n > 1 is an integer then n can be written as a product of primes Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 3 / 12

  7. Proof of fundamental theorem Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Showed by induction if n > 1 is an integer then n can be written as a product of primes Missing is uniqueness Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 3 / 12

  8. Proof of fundamental theorem Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Showed by induction if n > 1 is an integer then n can be written as a product of primes Missing is uniqueness Lemma if p is prime and p | a 1 a 2 . . . a n where each a i is an integer, then p | a j for some 1 ≤ j ≤ n Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 3 / 12

  9. Proof of fundamental theorem Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Showed by induction if n > 1 is an integer then n can be written as a product of primes Missing is uniqueness Lemma if p is prime and p | a 1 a 2 . . . a n where each a i is an integer, then p | a j for some 1 ≤ j ≤ n By induction too Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 3 / 12

  10. Proof of fundamental theorem Theorem (Fundamental Theorem of Arithmetic) Every positive integer greater than 1 can be written uniquely as a prime or as the product of its prime factors, written in order of nondecreasing size Showed by induction if n > 1 is an integer then n can be written as a product of primes Missing is uniqueness Lemma if p is prime and p | a 1 a 2 . . . a n where each a i is an integer, then p | a j for some 1 ≤ j ≤ n By induction too Now result follows Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 3 / 12

  11. There are infinitely many primes Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 4 / 12

  12. There are infinitely many primes Lemma Every natural number greater than one is either prime or it has a prime divisor Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 4 / 12

  13. There are infinitely many primes Lemma Every natural number greater than one is either prime or it has a prime divisor Follows from fundamental theorem Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 4 / 12

  14. There are infinitely many primes Lemma Every natural number greater than one is either prime or it has a prime divisor Follows from fundamental theorem Proof Suppose towards a contradiction that there are only finitely many primes p 1 , p 2 , p 3 , . . . , p k . Consider the number q = p 1 p 2 p 3 . . . p k + 1, the product of all the primes plus one. By hypothesis q cannot be prime because it is strictly larger than all the primes. Thus, by the lemma, it has a prime divisor, p . Because p 1 , p 2 , p 3 , . . . , p k are all the primes, p must be equal to one of them, so p is a divisor of their product. So we have that p divides p 1 p 2 p 3 . . . p k , and p divides q , but that means p divides their difference, which is 1. Therefore p ≤ 1. Contradiction. Therefore there are infinitely many primes. Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 4 / 12

  15. The Sieve of Eratosthenes How to find all primes between 2 and n ? Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 5 / 12

  16. The Sieve of Eratosthenes How to find all primes between 2 and n ? A very inefficient method of determining if a number n is prime Try every integer i ≤ √ n and see if n is divisible by i Write the numbers 2 , . . . , n into a list. Let i := 2 1 Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 5 / 12

  17. The Sieve of Eratosthenes How to find all primes between 2 and n ? A very inefficient method of determining if a number n is prime Try every integer i ≤ √ n and see if n is divisible by i Write the numbers 2 , . . . , n into a list. Let i := 2 1 Remove all strict multiples of i from the list 2 Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 5 / 12

  18. The Sieve of Eratosthenes How to find all primes between 2 and n ? A very inefficient method of determining if a number n is prime Try every integer i ≤ √ n and see if n is divisible by i Write the numbers 2 , . . . , n into a list. Let i := 2 1 Remove all strict multiples of i from the list 2 Let k be the smallest number present in the list s.t. k > i and let 3 i := k Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 5 / 12

  19. The Sieve of Eratosthenes How to find all primes between 2 and n ? A very inefficient method of determining if a number n is prime Try every integer i ≤ √ n and see if n is divisible by i Write the numbers 2 , . . . , n into a list. Let i := 2 1 Remove all strict multiples of i from the list 2 Let k be the smallest number present in the list s.t. k > i and let 3 i := k If i > √ n then stop else go to step 2 4 Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 5 / 12

  20. The Sieve of Eratosthenes How to find all primes between 2 and n ? A very inefficient method of determining if a number n is prime Try every integer i ≤ √ n and see if n is divisible by i Write the numbers 2 , . . . , n into a list. Let i := 2 1 Remove all strict multiples of i from the list 2 Let k be the smallest number present in the list s.t. k > i and let 3 i := k If i > √ n then stop else go to step 2 4 Testing if a number is prime can be done efficiently in polynomial time [Agrawal-Kayal-Saxena 2002], i.e., polynomial in the number of bits used to describe the input number. Efficient randomized tests had been available previously. Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 5 / 12

  21. Greatest common divisor Definition Let a , b ∈ Z + .The largest integer d such that d | a and d | b is called the greatest common divisor of a and b , written gcd ( a , b ) Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 6 / 12

  22. Greatest common divisor Definition Let a , b ∈ Z + .The largest integer d such that d | a and d | b is called the greatest common divisor of a and b , written gcd ( a , b ) gcd ( 24 , 36 ) = 12 Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 6 / 12

  23. Greatest common divisor Definition Let a , b ∈ Z + .The largest integer d such that d | a and d | b is called the greatest common divisor of a and b , written gcd ( a , b ) gcd ( 24 , 36 ) = 12 Definition The integers a and b are relatively prime (coprime) iff gcd ( a , b ) = 1 Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 6 / 12

  24. Greatest common divisor Definition Let a , b ∈ Z + .The largest integer d such that d | a and d | b is called the greatest common divisor of a and b , written gcd ( a , b ) gcd ( 24 , 36 ) = 12 Definition The integers a and b are relatively prime (coprime) iff gcd ( a , b ) = 1 9 and 22 are coprime (both are composite) Colin Stirling (Informatics) Discrete Mathematics (Chap 4) Today 6 / 12

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend