Discrete Mathematics with Applications MATH236 Dr. Hung P. Tong-Viet School of Mathematics, Statistics and Computer Science University of KwaZulu-Natal Pietermaritzburg Campus Semester 1, 2013 Tong-Viet (UKZN) MATH236 Semester 1, 2013 1 / 21
Table of contents 1 Equivalence relations 2 How to count Tong-Viet (UKZN) MATH236 Semester 1, 2013 2 / 21
Equivalence relations Congruence Let n be a positive integer Two integer x, y are congruence modulo n if n x y We write x y (mod n) if x and y are congruence modulo n Theorem Congruence modulo n is an equivalence relation Tong-Viet (UKZN) MATH236 Semester 1, 2013 3 / 21
Equivalence relations Congruence (cont.) Proof. We need to prove that congruence is reflexive, symmetric and transitive Reflexive: For all x Z, we have that x x = 0 n so x x (mod n) Symmetric: For x, y Z, if x y (mod n), then x y = t n. Hence y x = ( t) n. Thus y x (mod n) Tong-Viet (UKZN) MATH236 Semester 1, 2013 4 / 21
Equivalence relations Congruence (cont.) Proof. Transitive: Suppose that x y (mod n) and y z (mod n) Then x y = t n and y z = s n for s, t Z Hence, x z = (s + t) n. So x z (mod n) Tong-Viet (UKZN) MATH236 Semester 1, 2013 5 / 21
Equivalence relations Congruence (cont.) Equivalence Classes [0] = {, 3n, 2n, n, 0, n, 2n, 3n, } [1] = {, 3n + 1, 2n + 1, n + 1, 1, n + 1, 2n + 1, 3n + 1, } [2] = {, 3n + 2, 2n + 2, n + 2, 2, n + 2, 2n + 2, 3n + 2, } [3] = {, 3n + 3, 2n + 3, n + 3, 3, n + 3, 2n + 3, 3n + 3, } [n 1] = {, 2n 1, n 1, 1, n 1, 2n 1, 3n 1, 4n, } Tong-Viet (UKZN) MATH236 Semester 1, 2013 6 / 21
Equivalence relations Equivalence classes and Partition Theorem Let P be a partition of a set S. Then there exists an equivalence relation R on S for which S/R = P, i.e., the equivalence classes of R are the parts of P. Proof. Define a relation R as follows: xry if and only if x is in the same part of P as y We will prove that R is an equivalence relation Reflexive: As x is in the same part as itself, xrx Tong-Viet (UKZN) MATH236 Semester 1, 2013 7 / 21
Equivalence relations Equivalence classes and partitions Symmetric: If xry, then y is in the same part as x Hence x is also in the same part as y and thus yrx Transitive: If xry and yrz, then y is in the same part of x and z is in the same part of y Thus z is in the same part of x or xrz So R is an equivalence relation From the definition of R, we deduce that the equivalence classes of R coincide with the parts of P. Tong-Viet (UKZN) MATH236 Semester 1, 2013 8 / 21
Equivalence relations Summary of Chapter 1 1 Review of sets Union, intersection Difference, symmetric difference Cartesian products, complement DeMorgan s Law (Theorem) 2 Partitions Disjoint and pairwise disjoint Definition of partition 3 Relations Tong-Viet (UKZN) MATH236 Semester 1, 2013 9 / 21
Equivalence relations Summary of Chapter 1 (cont.) Definition of relations Properties of relations: reflexive, symmetric and transitive Equivalence relations and equivalence classes Theorem 2 : Let R be an equivalence relation on S and x, y S. Then [x] = [y] if and only if xry Theorem 3 : Let R be an equivalence relation on S. Then S/R is a partition of S Theorem 4 : Let P be a partition of S. Then there exists an equivalence relation R on S for which S/R = P. Tong-Viet (UKZN) MATH236 Semester 1, 2013 10 / 21
Counting Principles Definition (Counting Principle) If we count something in two different ways, then the two answers must be equal. A proof that uses this principle is called a combinatorial proof We now consider the following example: Theorem If A and B are finite sets, then A B = A + B A B Tong-Viet (UKZN) MATH236 Semester 1, 2013 11 / 21
Counting Principles (cont.) Proof. We will prove the following equivalent statement: We will use a combinatorial proof Imagine the following: A B + A B = A + B Line the elements of A up in front of a turnstyle As each passes through, give it a slip of paper Tong-Viet (UKZN) MATH236 Semester 1, 2013 12 / 21
Counting Principles (cont.) Proof. Now line the elements of B up in front of the turnstyle Again, as each passes through, give it a slip of paper Consider the following question: How many slips of paper in total did we give out? We will count the slips in two different ways Tong-Viet (UKZN) MATH236 Semester 1, 2013 13 / 21
Counting Principles (cont.) Proof. We gave one slip to each member of A We gave one slip to each member in B So clearly, we gave out A + B slips of paper Tong-Viet (UKZN) MATH236 Semester 1, 2013 14 / 21
Counting Principles (cont.) Proof. For each element of A B either it got one slip of paper, if it is in one of A or B but not both it got two slips of paper if it is in A B Clearly, we gave out ( A B A B ) + 2 A B = A B + A B Tong-Viet (UKZN) MATH236 Semester 1, 2013 15 / 21
Counting Principles (cont.) Proof. We re just count the total number of slips of paper in two different ways As both ways must give the same answer Therefore, The proof is now complete A + B = A B + A B Tong-Viet (UKZN) MATH236 Semester 1, 2013 16 / 21
Counting Principles (cont.) Here is a direct consequence of the previous theorem Corollary If A and B are disjoint finite sets, then A B = A + B This corollary can be generalized to: Theorem (Addition Principle) If {A 1, A 2,, A k } is a pairwise disjoint collection of finite sets, then k A i = i=1 k A i i=1 Tong-Viet (UKZN) MATH236 Semester 1, 2013 17 / 21
Counting Principles (cont.) We now obtain a consequence of the Addition Principle: Theorem If A and B are finite sets, then A B = A B Proof. Write A = {a 1, a 2,, a n } with n = A For each i = 1, 2,, n, let A i be the set of all ordered pairs (a i, b) where b B Then A B = n i=1 A i Tong-Viet (UKZN) MATH236 Semester 1, 2013 18 / 21
Counting Principles (cont.) Proof. We have A i = B for all i {A i } n i=1 is pairwise disjoint So {A 1, A 2,, A n } is a partition of A B. Thus n A B = n i=1 A i = A i = A B. i=1 Tong-Viet (UKZN) MATH236 Semester 1, 2013 19 / 21
Counting Principles (cont.) This theorem is one form of the Multiplication Principle Let S be a set of ordered pairs (s 1, s 2 ) of objects The first object s 1 comes from a set of size n 1 For each choice of object s 1, there are n 2 choices of object s 2 Then the set S contains n 1 n 2 ordered pairs Tong-Viet (UKZN) MATH236 Semester 1, 2013 20 / 21
Counting Principles (cont.) Example How many 2-digit numbers numbers contains no repeated digits? A 2-digit number ab can be thought of as the ordered paired (a, b) The first digit a can be anything except 0, so n 1 = 9 Once we chosen the first digit a, the second digit can be any number except the one we chose for a For each choice of a, the are 9 choices for b, so n 2 = 9 The Multiplication Principle implies that the total number number of 2-digit numbers without repetition is 9 9 = 81 Tong-Viet (UKZN) MATH236 Semester 1, 2013 21 / 21