CSE 1400 Applied Discrete Mathematics Relations and Functions Department of Computer Sciences College of Engineering Florida Tech
Total Page:16
File Type:pdf, Size:1020Kb
CSE 1400 Applied Discrete Mathematics Relations and Functions Department of Computer Sciences College of Engineering Florida Tech Spring 2012 Problems labeled ! are important and must be Problems on Relations mastered. are harder and cover interest- Background ing advanced material that is not properly part of this course. A (binary) relation is a set of ordered pairs are tangential to the course f(x, y) : x ∼ yg but cover material that is useful elsewhere. where ∼ is a relational symbol, for example, equal (=), less than (<), divides (j), congruence mod n (≡ (mod n)), subset (⊆), et cetera. Two important types of relations are equivalences and (partial) orders: • Equivalence relations are – reflexive (8x)(x ∼ x), – symmetric (8x, y)(x ∼ y ! y ∼ x), and – transitive (8x, y, z)((x ∼ y) ^ (y ∼ z) ! x ∼ z). • Partial orders are reflexive, transitive, and antisymmetric (8x, y)((x ∼ y) ^ (y ∼ x) ! x = y) or by contraposition (8x, y)(x 6= y ! (x 6∼ y) _ (y 6∼ x)) 1. ! (Recognize whether several important relations are reflexive or not.) Which of the following state- ments are True and which are False? (a) (8x 2 R)(x = x). Answer: This is True. Equality is a reflexive relation. (b) (8x 2 R)(x 6= x). Answer: This is False. Not equal is not a reflexive relation. (c) (8x 2 R)(x < x). Answer: This is False. Less than is not a reflexive relation. (d) (8x 2 R)(x ≥ x). Answer: This is True. Greater than or equal is a reflexive relation. (e) (8a 2 N)(a j a). Answer: This is True. Divides is a reflexive relation. (f) (8X 2 2U)(X ⊆ X). Answer: This is True. Subset is a reflexive relation. cse 1400 applied discrete mathematics relations and functions 2 (g) Let n 2 N, n > 1 be fixed. (8a 2 Z)(a ≡ a (mod n)). Answer: This is True. Congruence mod n is a reflexive relation. (h) (8a 2 Z)(gcd(a, a) = 1) Answer: This is False. The greatest common divisor of a and a is jaj, which is most often not equal to 1. That is, relatively prime is not a reflexive relation. 2. ! (Recognize whether several important relations are symmetric or not.) Which of the following state- ments are True and which are False? (a) (8x, y 2 R)((x = y) ! (y = x)). Answer: This is True. Equality is symmetric. (b) (8x, y 2 R)((x 6= y) ! (y 6= x)). Answer: This is True. Not equal is symmetric (c) (8x, y 2 R)(x < y ! y < x). Answer: This is False. Less than is not symmetric. (d) (8x, y 2 R)(x ≥ y ! y ≥ x). Answer: This is False. Greater than or equal is not symmetric. (e) (8a, b 2 N)(a j b ! b j a). Answer: This is False. Divides is not symmetric. (f) (8X, Y 2 2U)(X ⊆ Y ! Y ⊆ X). Answer: This is False. Subset is not symmetric. (g) Let n 2 N, n > 1 be fixed. (8a, b 2 Z)(a ≡ b (mod n) ! b ≡ a (mod n)). Answer: This is True. Congruence mod n is symmetric. (h) (8a, b 2 Z)(gcd(a, b) = 1 ! gcd(b, a) = 1). Answer: This is True. Relatively prime is symmetric. 3. ! (Recognize whether several important relations are antisymmetric or not.) Which of the following statements are True and which are False? (a) (8x, y 2 R)(((x = y) ^ (y = x)) ! (x = y)). Answer: This is True. Equality is antisymmetric. (b) (8x, y 2 R)((x 6= y ^ y 6= x) ! (x = y)). Answer: This is False. Not equal in not antisymmetric (c) (8x, y 2 R)((x < y ^ y < x) ! (x = y)). Answer: This is True. It is True by virtue of its logical form: p ! q where the premise p = (x < y ^ y < x) is always False which makes the conditional always True. (d) (8x, y 2 R)(x ≥ y ^ y ≥ x ! x = y). Answer: This is True. Greater than or equal is antisymmetric. (e) (8a, b 2 N)(a j b ^ b j a ! a = b). Answer: This is True. Divides is antisymmetric. (f) (8X, Y 2 2U)((X ⊆ Y) ^ (Y ⊆ X) ! X = Y). Answer: This is True. Subset is antisymmetric. (g) Let n 2 N, n > 1 be fixed. (8a, b 2 Z)(a ≡ b (mod n) ^ b ≡ a (mod n) ! a = b). Answer: This is False. Congruence mod n is not antisymmetric. cse 1400 applied discrete mathematics relations and functions 3 (h) (8a, b 2 Z)((gcd(a, b) = 1) ^ (gcd(b, a) = 1) ! a = b). Answer: This is False. Relatively prime is not antisymmetric. 4. ! (Recognize whether several important relations are transitive or not.) Which of the following state- ments are True and which are False? (a) (8x, y, z 2 R)(((x = y) ^ (y = z)) ! (x = z)). Answer: This is True. Equality is transitive. (b) (8x, y, z 2 R)((x 6= y ^ y 6= z) ! (x 6= z)). Answer: This is False. Not equal is not transitive. A counterexample to the statement that not equal is transitive is: x = 0, y = 1 and z = 0. (c) (8x, y, z 2 R)((x < y ^ y < z) ! (x < z)). Answer: This is True. Less than is transitive. (d) (8x, y, z 2 R)(x ≥ y ^ y ≥ z ! x ≥ z). Answer: This is True. Greater than or equal is transitive. (e) (8a, b, c 2 N)(a j b ^ b j c ! a j c). Answer: This is True. If a j b, then there is a natural number d such that ad = b. And, If b j c, then there is a natural number e such that be = c. Therefore a(de) = (ad)e = be = c and a divides c. Divides is transitive. (f) (8X, Y, Z 2 2U)((X ⊆ Y) ^ (Y ⊆ Z) ! X ⊆ Z). Answer: This is True. Subset is transitive. (g) Let n 2 N, n > 1 be fixed. (8a, b, c 2 Z)(a ≡ b (mod n) ^ b ≡ c (mod n) ! a ≡ c (mod n)). Answer: This is True. Congruence mod n is transitive. If a ≡ b (mod n), then a − b is a multiple of n. And, if b ≡ c (mod n), then b − c is a multiple of n. Therefore (a − b) + (b − c) = a − c is a multiple of n. (h) (8a, b, c 2 Z)((gcd(a, b) = 1) ^ (gcd(b, c) = 1) ! gcd(a, c) = 1). Answer: This is False. Relatively prime is not transitive. A counterexample is a = 2, b = 3 and c = 4. 5. (Be able to describe the relations determined by Boolean operations.) Describe these relations over the set of Boolean variables. (a) p ^ q = True Answer: This is the set f(1, 1)g. (b) p ^ q = False Answer: This is the set f(0, 0), (0, 1), (1, 0)g. (c) p _ q = True Answer: This is the set f(0, 1), (1, 0), (1, 1)g. (d) p _ q = False Answer: This is the set f(0, 0)g. (e) p ! q = True Answer: This is the set f(0, 0), (0, 1), (1, 1)g. (f) p ! q = False Answer: This is the set f(1, 0)g. (g) p ≡ q = True Answer: This is the set f(0, 0), (1, 1)g. cse 1400 applied discrete mathematics relations and functions 4 (h) p ≡ q = False Answer: This is the set f(0, 1), (1, 0)g. (i) p ⊕ q = True Answer: This is the set f(0, 1), (1, 0)g. (j) p ⊕ q = False Answer: This is the set f(0, 0), (1, 1)g. 6. (Be able to construct all relations in small cases.) List relations in the following instances. (a) The relations from fag to the set of bits B. Answer: i. Æ ii. f(a, 0)g iii. f(a, 1)g iv. f(a, 0), (a, 1)g (b) List all relations on the set of bits B. Answer: i. Æ ix. f(0, 1), (1, 0)g ii. f(0, 0)g x. f(0, 1), (1, 1)g iii. f(0, 1)g xi. f(1, 0), (1, 1)g iv. f(1, 0)g xii. f(0, 0), (0, 1), (1, 0)g v. f(1, 1)g xiii. f(0, 0), (0, 1), (1, 1)g vi. f(0, 0), (0, 1)g xiv. f(0, 0), (1, 0), (1, 1)g vii. f(0, 0), (1, 0)g xv. f(0, 1), (1, 0), (1, 1)g viii. f(0, 0), (1, 1)g xvi. f(0, 0), (0, 1), (1, 0), (1, 1)g 7. (Be able to recognize properties of relations from there representation as ordered pairs.) Which of the relations in problem 6b are reflexive, which are symmetric, which are antisymmetric, and which are transitive? Answer: • Reflexive: 8, 13, 14, 16 • Symmetric: 1, 2, 5, 8, 9, 12, 15, 16 • Antisymmetric: 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14 • Transitive: 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16 ! 8. (Be able to represent a relation as an adjacency matrix.) A relation on an n-element set A = fa0, a1,..., an−1g can be represented by an n × n adjacency matrix of Boolean values. 2 3 a0 a1 ··· an−1 6 7 6 a b b ··· b 7 6 0 0,0 0,1 0,n−1 7 6 7 6 a1 b1,0 b1,1 ··· b1,n−1 7 6 7 6 . 7 4 . ··· . 5 an−1 bn−1,0 bn−1,1 ··· bn−1,n−1 cse 1400 applied discrete mathematics relations and functions 5 Where the entries bi,j 2 B are Boolean values such that bi,j = 1 if ai is related to aj and bi,j = 0 otherwise.