Math.3336: Discrete Mathematics Primes and Greatest Common Divisors Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 1/16
Assignments to work on Homework #5 due Wednesday, 10/03, 11:59pm Homework #6 due Friday, 10/12, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 2/16
Chapter 4 Introduction Number theory is the branch of mathematics that deals with integers and their properties Number theory has a number of applications in computer science, esp. in modern cryptography This lecture: Important results in number theory Next lecture: Continue discussion of number theory, look at applications of number theory in cryptography Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 3/16
Chapter 4 Number Theory and Cryptography Chapter 4 Overview Divisibility and Modular Arithmetic Section 4.1 Integer Representations and Algorithms Section 4.2 Primes and Greatest Common Divisors Section 4.3 Solving Congruences Section 4.4 Applications of Congruences Section 4.5 (we skip it) Cryptography Section 4.6 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 4/16
A review on Divisibility and Congruence Modulo Given two integers a and b where a 0, we say a divides b if there is an integer c such that b = ac If a divides b, we write a b; otherwise, a b If a b, a is called a factor of b and b is called a multiple of a. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 5/16
Properties of Divisibility Theorem 1: If a b and a c, then a (b + c) Theorem 2: If a b, then a bc for all integers c Theorem 3: If a b and b c, then a c Theorem 4 If a b and a c, then a (mb + nc) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 6/16
The Division Theorem Division theorem: Let a be an integer, and d a positive integer. Then, there are unique integers q, r with 0 r < d such that a = dq + r Here, d is called divisor, and a is called dividend q is the quotient, and r is the remainder. We use the r = a mod d notation to express the remainder The notation q = a div d expresses the quotient Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 7/16
Congruence Modulo a and b are congruent modulo m, a b (mod m) if and only if m (a b) Theorem: a b (mod m) iff a mod m = b mod m If a b (mod m) and c d (mod m) and k Z, then a + c b + d (mod m) a c b d (mod m) ac bd (mod m) a + k b + k (mod m) ak bk (mod m) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 8/16
Shift Ciphers (a glimpse from Section 4.6) First, let s number letters A-Z with 0 25 Represent message with sequence of numbers Example: The sequence 25 0 2 represents ZAC To encrypt, apply encryption function f defined as: f (x) = (x + k) mod 26 Because f is bijective, its inverse yields decryption function: f 1 (x) = (x k) mod 26 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 9/16
Ciphers and Congruence Modulo Shift cipher is a very primitive and insecure cipher because very easy to infer what k is But contains some useful ideas: Encoding words as sequence of numbers Use of modulo operator Modern encryption schemes much more sophisticated, but also share these principles More on this next lecture! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 10/16
Section 4.3 Prime Numbers A positive integer p that is greater than 1 and divisible only by 1 and itself is called a prime number. First few primes: 2, 3, 5, 7, 11,... A positive integer that is greater than 1 and that is not prime is called a composite number Example: 4, 6, 8, 9,... Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 11/16
Fundamental Theorem of Arithmetic Fundamental Thm: Every positive integer greater than 1 is either prime or can be written uniquely as a product of primes. This unique product of prime numbers for x is called the prime factorization of x Examples: 12 = 2 2 3 21 = 3 7 99 = 3 3 11 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 12/16
Determining Prime-ness In many applications, such as crypto, important to determine if a number is prime following thm is useful for this: Theorem: If n is composite, then it has a prime divisor less than or equal to n Proof: Since n is composite, it can be written as n = ab where a > 1 and b > 1. For contradiction, suppose neither a nor b are n, i.e., a > n, b > n Then, n = ab > n 2 = n, a contradiction. Hence, either a n, or b n, and by the Fundamental Thm, is either itself a prime or has a factor less than itself. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 13/16
Consequence of This Theorem Theorem: If n is composite, then it has a prime divisor n Corollary: If n does not have a prime divisor n, then n is prime. Thus, to determine if n is prime, only need to check if it is divisible by primes n Example: Show that 101 is prime Since 101 < 11, only need to check if it is divisible by 2, 3, 5, 7. Since it is not divisible by any of these, we know it is prime. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 14/16
Infinitely Many Primes Theorem: There are infinitely many prime numbers. Proof: (by contradiction) Suppose there are finitely many primes: p 1, p 2,..., p n Now consider the number Q = p 1 p 2... p n + 1. Q is either prime or composite Case 1: Q is prime. We get a contradiction, because we assumed only prime numbers are p 1,..., p n Case 2: Q is composite. In this case, Q can be written as product of primes. But Q is not divisible by any of p 1, p 2,..., p n Hence, by Fundamental Thm, not composite Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 15/16
A Word about Prime Numbers and Cryptography Prime numbers play a key role in modern cryptography Modern cryptography techniques rely on prime numbers to encrypt messages Security of encryption relies on prime factorization being intractable for sufficiently large numbers Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Primes and Greatest Common Divisors 16/16