Math.3336: Discrete Mathematics Chapter 9 Relations 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 Chapter 9 Relations 1/19
Assignments to work on Homework #8 due Wednesday, 11/14, 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 Chapter 9 Relations 2/19
Chapter 9 Relations Chapter 9 Overview Relations and their Properties Section 9.1 n-ary Relations and Their Applications Section 9.2* Representing Relations Section 9.3 Closures of Relations Section 9.4 Equivalence Relations Section 9.5 Partial Orderings Section 9.6 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 3/19
Relations and Their Properties Binary Relations A binary relation R from a set A to a set B is a subset R A B. Example: Let A = {0, 1, 2} and B = {a, b}. Then: {(0, a), (0, b), (1, a), (1, b)} is relation from A to B. We can represent relations graphically or using a table: Relations are more general than functions. A function is a relation where exactly one element of B is related to each element of A. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 4/19
Relations and Their Properties Binary Relation on a Set A binary relation R on a set A is a subset A A. Examples: Let A = {a, b, c}. Then R = {(a, a), (a, b), (a, c)} is a relation on A. Let A = {1, 2, 3, 4}. Then R = {(a, b) : a divides b} is a relation on A, given by R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}. Question: How many relations are there on a set A? Since a relation is a subset of A A, then there are as many relations as the number of all subsets of A A, i.e. 2 A. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 5/19
Reflexive Relations A relation R is reflexive on A iff (a, a) R for every element a A. Written symbolically, R is reflexive if and only if a [a A (a, a) R]. Which of the following relations on integers are reflexive? R 1 = {(a, b) : a divides b} is not reflexive, because (0, 0) / R 1. R 2 = {(a, b) : a b} is reflexive: For all a Z, a a i.e. (a, a) R 2 R 3 = {(a, b) : a 2 = b 2 } is reflexive: For all a Z, a 2 = a 2 i.e. (a, a) R 3 If A =, then the empty relation is reflexive vacuously. That is the empty relation on an empty set is reflexive! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 6/19
Symmetric Relations A relation R is symmetric on A iff (b, a) R whenever (a, b) R. Written symbolically, R is symmetric if and only if a b [(a, b) R (b, a) R]. Which of the following relations on integers are symmetric: R 1 = {(a, b) : a divides b} is not symmetric: Note that (2, 4) R 1 but (4, 2) / R 1. R 2 = {(a, b) : a b} is not symmetric: Note that (3, 5) R 2 but (5, 3) / R 2. R 3 = {(a, b) : a 2 = b 2 } is symmetric: If (a, b) R 3, then a 2 = b 2 i.e. b 2 = a 2, which gives (b, a) R 3. R 4 = {(a, b) : a + b 3} is symmetric: If (a, b) R 4, then a + b < 3 i.e. b + a < 3, which gives (b, a) R 4. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 7/19
Antisymmetric Relations A relation R is antisymmetric on A iff for all a, b A, (a, b) R and (b, a) R implies a = b. Written symbolically, R is antisymmetric if and only if a b [(a, b) R (b, a) R a = b]. Which of the following relations on integers are antisymmetric: R 2 = {(a, b) : a b} is antisymmetric: If a b and b a, then a = b. R 5 = {(a, b) : a > b} is antisymmetric: If a > b, then b a and a b. R 6 = {(a, b) : a = b + 1} is antisymmetric: If a = b + 1, then a > b. Therefore b a and a b. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 8/19
Transitive Relations A relation R is transitive on A if whenever (a, b) R and (b, c) R implies (a, c) R. Written symbolically, R is transitive if and only if a b c [(a, b) R (b, c) R (a, c) R]. Which of the following relations on integers are transitive: R 1 = {(a, b) : a divides b} is transitive: If a b and b c, then a c. R 2 = {(a, b) : a b} is transitive: If a b and b c, then a c. R 5 = {(a, b) : a > b} is transitive: If a > b and b > c, then a > c. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 9/19
Examples The following relations are defined on the set A = {a, b, c}. Determine whether they are reflexive, symmetric, antisymmetric and/or transitive. R = {(a, a), (b, b), (a, b), (b, a)} not reflexive, symmetric, transitive, not antisymmetric. S = {(a, a), (b, b), (c, c), (a, b), (b, c)} reflexive, not symmetric, not transitive, antisymmetric. T = {(a, a), (b, b), (c, c), (a, b), (b, a), (b, c), (a, c)} reflexive, not symmetric, transitive, not antisymmetric. U = {(a, a), (b, b), (c, c)} reflexive, symmetric, transitive, antisymmetric. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 10/19
Representing Relations using Matrices A relation between finite sets can be represented using a zero-one matrix. Suppose R is a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. The relation R is represented by the matrix M R = [m ij ], where m ij = { 1, if (ai, b j ) R 0, if (a i, b j ) / R The matrix representing R has a 1 as its (i, j ) entry when a i is related to b j and a 0 if a i is not related to b j. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 11/19
Examples Let A = {1, 2, 3} and B = {1, 2}. The order of elements is the same as the numerical increasing order. Write the matrix representation for R = {(a, b) : a > b}. 0 0 Since R = {(2, 1), (3, 1), (3, 2)}, then M R = 1 0. 1 1 Let A = {a 1, a 2, a 3 } and B = {b 1, b 2, b 3, b 4, b 5 }. Write explicitly the relation S represented by 0 1 0 0 0 M S = 1 0 0 1 0 1 0 1 0 1 S = {(a 1, b 2 ), (a 2, b 1 ), (a 2, b 4 ), (a 3, b 1 ), (a 3, b 3 ), (a 3, b 5 )} Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 12/19
Matrices of Relations on Sets If R is a reflexive relation, all the elements on the main diagonal of M R are equal to 1. R is a symmetric relation, if and only if m ij = 1 whenever m ji = 1. R is an antisymmetric relation, if and only if m ij = 0 or m ji = 0 when i j. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 13/19
An Example Suppose that the relation R on a set is represented by the matrix 1 1 0 M R = 1 1 1 0 1 1 Is R reflexive, symmetric, and/or antisymmetric? Solution: R is reflexive and symmetric, but it is not antisymmetric. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 14/19
Representing Relations Using Digraphs A directed graph, or digraph, consists of a set V of vertices (or nodes) together with a set E of ordered pairs of elements of V called edges (or arcs). The vertex a is called the initial vertex of the edge (a, b), and the vertex b is called the terminal vertex of this edge. An edge of the form (a, a) is called a loop. A directed graph with vertices V = {a, b, c, d} and edges E = {(a, b), (a, d), (b, b), (b, d), (c, a), (c, b), (d, b)} is shown here. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 15/19
Examples of Digraphs Representing Relations What are the ordered pairs in the relation represented by this directed graph? R = {(1, 3), (1, 4), (2, 1), (2, 2), (2, 3), (3, 1), (3, 3), (4, 1), (4, 3)} Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 16/19
Determining which Properties a Relation has from its Digraph Reflexivity: A loop must be present at all vertices in the graph. Symmetry: If (x, y) is an edge, then so is (y, x). Antisymmetry: If (x, y) with x y is an edge, then (y, x) is not an edge. Transitivity: If (x, y) and (y, z) are edges, then so is (x, z). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 17/19
Equivalence Relations A relation R on a set A is called an equivalence relation if R is reflexive, symmetric, and transitive. Two elements a and b that are related by an equivalence relation are called equivalent. The notation a b is often used to denote that a and b are equivalent elements with respect to a particular equivalence relation. Which of the following relations on positive integers are equivalence relations: R 1 = {(a, b) : a divides b} is not an equivalence relation, because it is not symmetric. R 3 = {(a, b) : a 2 = b 2 } is an equivalence relation. R = {(a, b) : a b (mod m)} is an equivalence relation. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 18/19
Partial Orderings A relation R on a set A is called a partial ordering if R is reflexive, antisymmetric, and transitive. A set S together with a partial ordering R is called a partially ordered set, or poset, and is denoted by (S, R). Members of S are called elements of the poset. Which of the following relations on positive integers are partial orderings: R 1 = {(a, b) : a divides b} is a partial ordering. R 2 = {(a, b) : a b} is a partial ordering. R 5 = {(a, b) : a > b} is not a partial ordering, since it is not reflexive. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Chapter 9 Relations 19/19