* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download CS311H: Discrete Mathematics Cardinality of Infinite Sets and
Philosophy of mathematics wikipedia , lookup
History of mathematical notation wikipedia , lookup
Infinitesimal wikipedia , lookup
Georg Cantor's first set theory article wikipedia , lookup
Critical mathematics pedagogy wikipedia , lookup
Topological quantum field theory wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
Series (mathematics) wikipedia , lookup
Secondary School Mathematics Curriculum Improvement Study wikipedia , lookup
Non-standard analysis wikipedia , lookup
Quadratic reciprocity wikipedia , lookup
History of mathematics wikipedia , lookup
Mathematics wikipedia , lookup
Model theory wikipedia , lookup
Computability theory wikipedia , lookup
Hyperreal number wikipedia , lookup
Ethnomathematics wikipedia , lookup
Mathematical logic wikipedia , lookup
List of first-order theories wikipedia , lookup
List of important publications in mathematics wikipedia , lookup
Elementary mathematics wikipedia , lookup
Proofs of Fermat's little theorem wikipedia , lookup
Foundations of mathematics wikipedia , lookup
Announcements CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory Instructor: Işıl Dillig Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 1/33 Homework 4 due now I Midterm next lecture; covers everything up to this lecture I Recall: Midterm closed-book, closed-notes, but can bring 3-pages of hand-prepared notes Instructor: Işıl Dillig, Cardinality of Infinite Sets I I CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 2/33 Example Sets with infinite cardinality are classified into two classes: Prove: The set of odd positive integers is countably infinite. 1. Countably infinite sets (e.g., natural numbers) I Need to find a function f from Z+ to the set of odd positive integers, and prove that f is bijective I Consider f (n) = 2n − 1 from Z+ to odd positive integers I We need to show f is bijective (i.e., one-to-one and onto) I Let’s first prove injectivity, then surjectivity 2. Uncountably infinite sets (e.g., real numbers) I A set A is called countably infinite if there is a bijection between A and the set of positive integers. I A set A is called countable if it is either finite or countably infinite I Otherwise, the set is called uncountable or uncountably infinite Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 3/33 Instructor: Işıl Dillig, Example, cont. Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 4/33 Another Way to Prove Countable-ness CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 5/33 I One way to show a set A is countably infinite is to give bijection between Z+ and A I Another way is by showing members of A can be written as a sequence (a1 , a2 , a3 , . . .) I Since such a sequence is a bijective function from Z+ to A, writing A as a sequence a1 , a2 , a3 , . . . establishes one-to-one correspondence Instructor: Işıl Dillig, 1 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 6/33 Another Example Rational Numbers are Countable Prove that the set of all integers is countable I We can list all integers in a sequence, alternating positive and negative integers: an = 0, 1, −1, 2, −2, 3, −3, . . . I Instructor: Işıl Dillig, Observe that this sequence defines the bijective function: n/2 if n even f (n) = −(n − 1)/2 if n odd CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 7/33 Set of rationals is also countably infinite! I We’ll prove that the set of positive rational numbers is countable by showing how to enumerate them in a sequence I Recall: Every positive rational number can be written as the quotient p/q of two positive integers p, q Instructor: Işıl Dillig, Rationals in a Table I I CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 8/33 Enumerating the Rationals Now imagine placing rationals in a table such that: 1. Rationals with p = 1 go in first row, p = 2 in second row, etc. 2. Rationals with q = 1 in 1st column, q = 2 in 2nd column, . . . Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory First list those with p + q = 2, then p + q = 3, . . . I Traverse table diagonally from left-to-right, in the order shown by arrows Instructor: Işıl Dillig, 9/33 Enumerating the Rationals, cont. I I CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 10/33 Uncountability of Real Numbers This allows us to list all rationals in a sequence: I Prime example of uncountably infinite sets is real numbers I Proven by George Cantor using the famous diagonalization argument I For contradiction, assume the set of reals was countable I Since any subset of a countable set is also countable, this would imply the set of reals between 0 and 1 is also countable 1 2 1 1 2 3 4 3 , , , , , , , ,... 1 1 2 3 2 1 1 2 I Instructor: Işıl Dillig, Hence, set of rationals is countable CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory Instructor: Işıl Dillig, 11/33 2 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 12/33 Diagonalization Argument I Diagonalization Argument, concluded Now, we’ll create a new real number R and show that it is not equal to any of the Ri ’s in this sequence: I Let R = 0.a1 a2 a3 . . . such that: 4 dii 6= 4 ai = 5 dii = 4 I Clearly, this new number R differs from each number Ri in the table in at least one digit (its i ’th digit) Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory Number theory is the branch of mathematics that deals with integers and their properties I Number theory has a number of applications in computer science, esp. in modern cryptography Next few lectures: Basic concepts in number theory and its application in crypto in cryptography CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory Hence, the set of real between 0 and 1 is not countable I Since the superset of any uncountable set is also uncountable, set of reals is uncountably infinite I If a divides b, we write a|b; otherwise, a 6 | b I Example: 2|6, 2 6 | 9 I If a|b, a is called a factor of b I b is called a multiple of a 14/33 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 16/33 Properties of Divisibility I I Recall: All positive integers divisible by d are of the form dk I I We want to find how many numbers dk there are such that 0 < dk ≤ n. I I In other words, we want to know how many integers k there are such that 0 < k ≤ nd Instructor: Işıl Dillig, Cardinality of Infinite Sets and Introduction to Number Theory Given two integers a and b where a 6= 0, we say a divides b if there is an integer c such that b = ac Question: If n and d are positive integers, how many positive integers not exceeding n are divisible by d ? I CS311H: Discrete Mathematics I Instructor: Işıl Dillig, 15/33 Example I I Divisibility I Instructor: Işıl Dillig, Since R is not in the table, this is not a complete enumeration of all reals between 0 and 1 Instructor: Işıl Dillig, 13/33 Introduction to Number Theory I I How many integers are there between 1 and CS311H: Discrete Mathematics Theorem 1: If a|b and b|c, then a|c I I n d? Cardinality of Infinite Sets and Introduction to Number Theory 17/33 Instructor: Işıl Dillig, 3 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 18/33 Divisibility Properties, cont. I Theorem 2: If a|b and a|c, then a|(mb + nc) for any int m, n I Proof: I Corollary 1: If a|b and a|c, then a|(b + c) for any int c I Corollary 2: If a|b, then a|mb for any int m Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 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 I Here, d is called divisor, and a is called dividend I q is the quotient, and r is the remainder. I We use the r = a mod d notation to express the remainder I The notation q = a div d expresses the quotient I What is 101 mod 11? I What is 101 div 11? Instructor: Işıl Dillig, 19/33 Congruence Modulo I I CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory Congruence Modulo Theorem In number theory, we often care if two integers a, b have same remainder when divided by m. I Theorem: a ≡ b (mod m) iff a mod m = b mod m I Part 1, ⇒: Suppose a ≡ b (mod m). I If so, a and b are congruent modulo m, a ≡ b (mod m). I Then, by definition of ≡, m|(a − b) I More technically, if a and b are integers and m a positive integer, a ≡ b (mod m) iff m|(a − b) I By definition of |, there exists k such that a − b = mk , i.e., a = b + mk I Example: 7 and 13 are congruent modulo 3. I By division thm, b = mp + r for some 0 ≤ r < m I Example: Find a number congruent to 7 modulo 4. I Then, a = mp + r + mk = m(p + k ) + r I Thus, a mod m = r = b mod m Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 21/33 Instructor: Işıl Dillig, Congruence Modulo Theorem Proof, cont. I Theorem: a ≡ b (mod m) iff a mod m = b mod m I Part 2, ⇐: Suppose a mod m = b mod m I Then, there exists some p1 , p2 , r such that a = p1 · m + r and b = p2 · m + r where 0 ≤ r < m I 22/33 Prove that if a ≡ b (mod m) and c ≡ d (mod m), then: I I I I Thus, m|(a − b) I I By definition of ≡, a ≡ b (mod m) I Cardinality of Infinite Sets and Introduction to Number Theory Cardinality of Infinite Sets and Introduction to Number Theory a + c ≡ b + d (mod m) Then, a − b = p1 · m + r − p2 · m − r = m · (p1 − p2 ) CS311H: Discrete Mathematics CS311H: Discrete Mathematics Example I Instructor: Işıl Dillig, 20/33 23/33 Instructor: Işıl Dillig, 4 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 24/33 Applications of Congruence in Cryptography I Congruences have many applications in cryptography, e.g., shift ciphers I Shift cipher with key k encrypts message by shifting each letter by k letters in alphabet (if past Z , then wrap around) I What is encryption of ”KILL HIM” with shift cipher of key 3? I Shift ciphers also called Ceasar ciphers because Julius Ceasar encrypted secret messages to his generals this way Mathematical Encoding of Shift Ciphers I First, let’s number letters A-Z with 0 − 25 I Represent message with sequence of numbers I Example: The sequence ”25 0 2” represents ”ZAC” I To encrypt, apply encryption function f defined as: f (x ) = (x + k ) mod 26 I Because f is bijective, its inverse yields decryption function: g(x ) = (x − k ) mod 26 Instructor: Işıl Dillig, CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 25/33 Instructor: Işıl Dillig, Ciphers and Congruence Modulo I Shift cipher is a very primitive and insecure cipher because very easy to infer what k is I But contains some useful ideas: I I Encoding words as sequence of numbers I Use of modulo operator CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 27/33 Fundamental Thm: Every positive integer greater than 1 is either prime or can be written uniquely as a product of primes. I This unique product of prime numbers for x is called the prime factorization of x I Examples: Instructor: Işıl Dillig, I A positive integer p that is greater than 1 and divisible only by 1 and itself is called a prime number. I First few primes: 2, 3, 5, 7, 11, . . . I A positive integer that is greater than 1 and that is not prime is called a composite number I Example: 4, 6, 8, 9, . . . Instructor: Işıl Dillig, Fundamental Theorem of Arithmetic I Cardinality of Infinite Sets and Introduction to Number Theory 26/33 Prime Numbers Modern encryption schemes much more sophisticated, but also share these principles (coming lectures) Instructor: Işıl Dillig, CS311H: Discrete Mathematics CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 28/33 Determining Prime-ness I In many applications, such as crypto, important to determine if a number is prime – following thm is useful for this: I Theorem: If n is composite, then it has a prime divisor less √ than or equal to n I I 12 = I I 21 = I I 99 = I CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 29/33 Instructor: Işıl Dillig, 5 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 30/33 Consequence of This Theorem Theorem: If n is composite, then it has a prime divisor ≤ Infinitely Many Primes √ n I Thus, to determine if n is prime, only need to check if it is √ divisible by primes ≤ n I Example: Show that 101 is prime I I Instructor: Işıl Dillig, I Theorem: There are infinitely many prime numbers. I Proof: (by contradiction) Suppose there are finitely many primes: p1 , p2 , . . . , pn I Now consider the number Q = p1 p2 . . . pn + 1. Q is either prime or composite I Case 1: Q is prime. We get a contradiction, because we assumed only prime numbers are p1 , . . . , pn I Case 2: Q is composite. In this case, Q can be written as product of primes. I But Q is not divisible by any of p1 , p2 , . . . , pn I Hence, by Fundamental Thm, not composite ⇒ ⊥ √ 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. CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 31/33 Instructor: Işıl Dillig, 6 CS311H: Discrete Mathematics Cardinality of Infinite Sets and Introduction to Number Theory 32/33