Rosen_Discr-Math_Appls_6th-Ed._MGH (2006)-2 - C H APTER Relations 8.1 Relations and Their Properties 8.2 n-ary Relations and Their Applications 8.3

Rosen_Discr-Math_Appls_6th-Ed._MGH (2006)-2 - C H APTER...

This preview shows page 1 out of 463 pages.

You've reached the end of your free preview.

Want to read all 463 pages?

Unformatted text preview: C H APTER Relations 8.1 Relations and Their Properties 8.2 n-ary Relations and Their Applications 8.3 Representing Relations 8.4 Closures of Relations 8.5 Equivalence Relations 8.6 Partial Orderings IT)) elationships between elements of sets occur in many contexts. Every day we deal with l&. relationships such as those between a business and its telephone n umber, an employee and his or her salary, a person and a relative, and so on. In mathematics we study relationships such as those between a positive integer and one that it divides, an integer and one that it is congruent to modulo 5, a real number and one that is larger than it, a real number value f(x) where f is a function, and so on. x and the Relationships such as that between a program and a variable it uses and that between a computer language and a valid statement in this language often arise in computer science. Relationships between elements of sets are represented using the structure called a relation, which is just a subset of the Cartesian product of the sets. Relations can be used to solve problems such as determining which pairs of cities are linked by airline flights in a network, finding a viable order for the different phases of a complicated project, or producing a useful way to store information in computer databases. In some computer languages, only the first 31 characters of the name of a variable matter. The relation consisting of ordered pairs of strings where the first string has the same initial 31 characters as the second string is an example of a special type of relation, known as an equivalence relation. Equivalence relations arise throughout mathematics and computer science. We will study equivalence relations, and other special types of relations, in this chapter. 8.1 Relations and Their Properties Introduction The most direct way to express a relationship between elements of two sets is to use ordered pairs made up of two related elements. For this reason, sets of ordered pairs are called binary relations. In this section we introduce the basic terminology used to describe binary relations. Later in this chapter we will use relations to solve problems involving communications networks, project scheduling, and identifying elements in sets with common properties. DEFINITION 1 Let A and B be sets. A binary relation from A to B is a subset of A x B. In other words, a binary relation from A to B is a set R of ordered pairs where the first element of each ordered pair comes from A and the second element comes from B. We use the notation aRb (a, b) E R and aRb to denote a is said to be related to b by R. to denote that belongs to R, that (a, b) t/:. R. Moreover, when (a, b) Binary relations represent relationships between the elements of two sets. We will introduce n-ary relations, which express relationships among elements of more than two sets, later in this chapter. We will omit the word binary when there is no danger of confusion. Examples EXAMPLE 1 1 3 illustrate the notion of a relation. � Let A be the set of students in your school, and let B be the set of courses. Let R be the relation that consists of those pairs 8-/ (a, b), where a is a student enrolled in course b. For instance, if 519 520 8-2 8 / Relations oe � ea Ie / R a b 0 X X X eb 2 X 2e FIGURE 1 Displaying the Ordered Pairs in the Relation R from Example 3. Jason Goodfriend and Deborah Sherman are enrolled in CS5 1 8, the pairs (Jason Goodfriend, CS5 1 8) and (Deborah Sherman, CS5 1 8) belong to R . If Jason Goodfriend is also enrolled in CS5 1 O, then the pair (Jason Goodfriend, CS5 1 O) is also in R . However, if Deborah Sherman is not enrolled in CS5 1 O, then the pair (Deborah Sherman, CS5 1 O) is not in R . Note that if a student is not currently enrolled in any courses there will be no pairs in R that have this student as the first element. Similarly, if a course is not currently being offered there .... will be no pairs in R that have this course as their second element. EXAMPLE 2 Let A be the set of all cities, and let B be the set of the 50 states in the United States of America. Define the relation R by specifying that (a , b) belongs to R if city a is in state b. For instance, (Boulder, Colorado), (Bangor, Maine), (Ann Arbor, Michigan), (Middletown, New Jersey), (Middletown, New York), (Cupertino, California), and (Red Bank, New Jersey) are .... in R . EXAMPLE 3 Let A = {O, 1 , 2} and B = {a , b}. Then {(O, a), (0, b), ( 1 , a), (2, b)} is a relation from A to B . This means, for instance, that ORa, but that 1 � b. Relations can be represented graphically, as shown in Figure 1 , using arrows to represent ordered pairs. Another way to represent this relation is to use a table, which is also done in Figure 1 . We will discuss representations of .... relations in more detail in Section 8.3. Functions as Relations Recall that a function f from a set A to a set B (as defined in Section 2.3) assigns exactly one element of B to each element of A . The graph of f is the set of ordered pairs (a , b) such that b = f(a). Because the graph of f is a subset of A x B, it is a relation from A to B. Moreover, the graph of a function has the property that every element of A is the first element of exactly one ordered pair of the graph. Conversely, if R is a relation from A to B such that every element in A is the first element of exactly one ordered pair of R , then a function can be defined with R as its graph. This can be done by assigning to an element a of A the unique element b E B such that (a , b) E R . (Note that the relation R in Example 2 is not the graph of a function because Middletown occurs more than once as the first element of an ordered pair in R .) A relation can be used to express a one-to-many relationship between the elements of the sets A and B (as in Example 2), where an element of A may be related to more than one element of B . A function represents a relation where exactly one element of B is related to each element of A. Relations are a generalization of functions; they can be used to express a much wider class of relationships between sets. 8-3 8. 1 Relations and Their Properties 52 1 Relations on a Set Relations from a set A to itself are of special interest. DEFINITION 2 A relation on the set A is a relation from A to A . In other words, a relation on a set A i s a subset o f A EXAMPLE 4 x A. Let A be the set { l , 2, 3 , 4}. Which ordered pairs are in the relation R = {(a , b) I a divides b}? Solution: Because (a , b) is in R if and only if a and b are positive integers not exceeding 4 such that a divides b, we see that R = {( 1 , 1) , ( 1 , 2), ( 1 , 3), ( 1 , 4), (2, 2), (2, 4), (3 , 3), (4, 4) } . The pairs i n this relation are displayed both graphically and i n tabular form i n Figure 2 . Next, some examples o f relations o n the set o f integers will b e given i n Example 5 . EXAMPLE 5 Consider these relations on the set of integers: R\ = R2 = R3 = R4 = Rs = R6 = {(a , b) {(a , b ) {(a , b ) {(a , b ) {(a , b ) {(a , b) I I I I I I a ::s b } , a> b } , a = b or a = - b } , a = b}, a = b+ I } , a +b ::s 3 } . Which o f these relations contain each o f the pairs ( 1 , 1 ), ( 1 , 2), (2, 1 ), ( 1 , - 1 ), and (2, 2)? Remark: Unlike the relations in Examples 1 -4, these are relations on an infinite set. Solution: The pair ( 1 , 1 ) is in R\, R 3 , R4, and R6; ( 1 , 2) is in R\ and R6; (2, 1 ) is in R2, Rs , and .... R6; ( 1 , - 1 ) is in R2, R 3 , and R6; and finally, (2, 2) is in R\, R3 , and R4 • R x 2 3 4 4. -- 2 3 4 x x x x x x x ---.<.. FIGURE 2 Displaying the Ordered Pairs in the Relation R from Example 4. 522 8 / Relations 8-4 It is not hard to determine the number of relations on a finite set, because a relation on a set A is simply a subset of A x A. EXAMPLE 6 How many relations are there on a set with n elements? Solution: A relation on a set A is a subset of A x A . Because A x A has n 2 elements when A 2 has n elements, and a set with m elements has 2m subsets, there are 2 n subsets of A x A. Thus, 2 there are 2 n relations on a set with n elements. For example, there are 23 2 = 29 = 5 1 2 relations � on the set {a , b, c}. Properties of Relations There are several properties that are used to classify relations on a set. We will introduce the most important of these here. In some relations an element is always related to itself. For instance, let R be the relation on the set of all people consisting of pairs (x , y) where x and y have the same mother and the same father. Then x R x for every person x . DEFINITION 3 A relation R on a set A i s called reflexive i f (a, a) E R for every element a EA. Remark: Using quantifiers we see that the relation R on the set A is reflexive if Va«a , a) E R), where the universe of discourse is the set of all elements in A . We see that a relation on A is reflexive if every element of A is related to itself. Examples 7-9 illustrate the concept of a reflexive relation. EXAMPLE 7 Consider the following relations on { l , 2, 3 , 4} : RJ = R2 = R3 R4 = R5 = = R6 = {( 1 , 1 ), ( 1 , 2), (2, 1 ), (2, 2), (3 , 4), (4, 1), (4, 4)} , {( 1 , 1 ), ( 1 , 2), (2, I ) } , {(I , 1) , ( 1 , 2 ) , ( 1 , 4), (2, 1 ), (2, 2), (3 , 3 ) , (4, 1), (4, 4)}, {(2, 1 ), (3 , 1) , (3 , 2), (4, 1 ) , (4, 2), (4, 3)} , {( 1 , 1 ) , ( 1 , 2), ( 1 , 3), ( 1 , 4), (2, 2), (2, 3), (2, 4), (3 , 3), (3 , 4), (4, 4)} , {(3 , 4)} . Which of these relations are reflexive? Solution: The relations R3 and R5 are reflexive because they both contain all pairs of the form (a , a), namely, ( 1 , 1 ), (2, 2), (3 , 3), and (4, 4). The other relations are not reflexive because they do not contain all of these ordered pairs. In particular, R J , R 2 , R4, and R6 are not reflexive � because (3 , 3) is not in any of these relations. EXAMPLE 8 Which of the relations from Example 5 are reflexive? Solution: The reflexive relations from Example 5 are RJ (because a :::: a for every integer a), R3 , and R4 . For each of the other relations in this example it is easy to find a pair of the form � (a , a) that is not in the relation. (This is left as an exercise for the reader.) 8-5 8.1 Relations and Their Properties EXAMPLE 9 523 Is the "divides" relation on the set of positive integers reflexive? Solution: Because a I a whenever a is a positive integer, the "divides" relation is reflexive. (Note that if we replace the set of positive integers with the set of all integers the relation is not reflexive � because 0 does not divide 0.) In some relations an element is related to a second element if and only if the second element is also related to the first element. The relation consisting of pairs (x , y), where x and y are students at your school with at least one common class has this property. Other relations have the property that if an element is related to a second element, then this second element is not related to the first. The relation consisting of the pairs (x , y), where x and y are students at your school, where x has a higher grade point average than y has this property. DEFINITION 4 A relation R on a setA is called symmetric if(b , a) E R whenever (a , b) E R , for all a , b E A. A relation R on a set A such that for all a, b E A, if (a , b) E Rand (b, a) E R , then a = b is called antisymmetric. Remark: Using quantifiers, we see that the relation R on the set A is symmetric if R R VaVb«a , b) E (b, a) E R). Similarly, the relation R on the set A is antisymmetric if VaVb«(a , b) E /\ (b, a) E R) --+ (a = b)). --+ That is, a relation is symmetric if and only if a is related to b implies that b is related to a . A relation i s anti symmetric i f and only i f there are no pairs o f distinct elements a and b with a related to b and b related to a . That is, the only way to have a related to b and b related to a is for a and b to be the same element. The terms symmetric and antisymmetric are not opposites, because a relation can have both of these properties or may lack both of them (see Exercise 8 at the end of this section). A relation cannot be both symmetric and anti symmetric if it contains some pair of the form (a , b), where a =1= b. Remark: Although relatively few of the 2 2n relations on a set with n elements are symmetric or antisymmetric, as counting arguments can show, many important relations have one of these properties. (See Exercise 45.) EXAMPLE 10 Ex1ra � Examples � EXAMPLE 11 Which of the relations from Example 7 are symmetric and which are anti symmetric? Solution: The relations R2 and R3 are symmetric, because in each case (b, a) belongs to the relation whenever (a , b) does. For R 2 , the only thing to check is that both (2, 1 ) and ( 1 , 2) are in the relation. For R 3 , it is necessary to check that both ( 1 , 2) and (2, I ) belong to the relation, and ( I , 4) and (4, I ) belong to the relation. The reader should verify that none of the other relations is symmetric. This is done by finding a pair (a , b) such that it is in the relation but (b, a) is not. R4 , Rs , and R6 are all antisymmetric. For each of these relations there is no pair of elements a and b with a =1= b such that both (a , b) and (b, a) belong to the relation. The reader should verify that none of the other relations is antisymmetric. This is done by finding a pair (a , b) with � a =1= b such that (a , b) and (b, a) are both in the relation. Which of the relations from Example 5 are symmetric and which are anti symmetric? Solution: The relations R3 , R4, and R6 are symmetric. R 3 is symmetric, for if a = b or a = -b, = a or b = -a. R4 is symmetric because a = b implies that b = a. R6 is symmetric then b 524 8-6 8 / Relations because a +b ::: 3 implies that b +a ::: 3 . The reader should verify that none of the other relations is symmetric. The relations R I , R 2 , R4, and R5 are antisymmetric. R I is anti symmetric because the inequalities a ::: b and b ::: a imply that a = b. R2 is anti symmetric because it is impossible for a > b and b > a . R4 is antisymmetric, because two elements are related with respect to R4 if and only if they are equal. R5 is anti symmetric because it is impossible that a = b+ I and ... b = a + I . The reader should verify that none of the other relations is antisymmetric. EXAMPLE 12 Is the "divides" relation on the set of positive integers symmetric? Is it antisymmetric? Solution: This relation is not symmetric because 1 12, but 2 y 1 . It is anti symmetric, for if a and b are positive integers with alb and b 1a, then a for the reader). = b (the verification of this is left as an exercise ... Let R be the relation consisting of all pairs (x , y) of students at your school, where x has taken more credits than y. Suppose that x is related to y and y is related to z. This means that x has taken more credits than y and y has taken more credits than z . We can conclude that x has taken more credits than z, so that x is related to z. What we have shown is that R has the transitive property, which is defined as follows. DEFINITION 5 A relation R on a set A is called transitive if whenever (a , b) E R and (b, c) E R, then (a , c) E R , for all a , b , c EA. Remark: Using quantifiers we see that the relation R on a set A is transitive if we have 'Va 'Vb 'Vc«(a , b) E R EXAMPLE 13 Extra � Examples� EXAMPLE 14 /\ (b, c) E R) -+ (a , c) E R). Which of the relations in Example 7 are transitive? Solution: R4, R5 , and R6 are transitive. For each of these relations, we can show that it is transitive by verifying that if (a , b) and (b, c) belong to this relation, then (a , c) also does. For instance, R4 is transitive, because (3 , 2) and (2, I ), (4, 2) and (2, I ), (4, 3) and (3 , I ), and (4, 3) and (3 , 2) are the only such sets of pairs, and (3 , I ), (4, I ), and (4, 2) belong to R4• The reader should verify that R5 and R6 are transitive. R I is not transitive because (3 , 4) and (4, I ) belong to R I , but (3 , I ) does not. R2 is not transitive because (2 , I ) and ( 1 , 2) belong to R 2 , but (2, 2) does not. R3 is not transitive because ... (4, I ) and ( 1 , 2) belong to R3 , but (4, 2) does not. Which of the relations in Example 5 are transitive? Solution: The relations R I , R 2 , R 3 , and R4 are transitive. R I is transitive because a ::: b and b ::: c imply that a ::: c. R2 is transitive because a > b and b > c imply that a > c. R3 is transitive because a = ±b and b = ±c imply that a = ±c. R4 is clearly transitive, as the reader should verify. R5 is not transitive because (2 , I ) and ( 1 , 0) belong to R5 , but (2, 0) does not. R6 is not ... transitive because (2, 1 ) and ( 1 , 2) belong to R6, but (2, 2) does not. EXAMPLE 15 Is the "divides" relation on the set of positive integers transitive? Solution: Suppose that a divides b and b divides c. Then there are positive integers k and I such that b = ak and c = bl. Hence, c = a(kl ) , so a divides c. It follows that this relation is transitive. ... 8-7 8.1 Relations and Their Properties 525 We can use counting techniques to determine the number of relations with specific proper­ ties. Finding the number of relations with a particular property provides information about how common this property is in the set of all relations on a set with n elements. EXAMPLE 16 How many reflexive relations are there on a set with n elements? Solution: A relation R on a set A is a subset of A x A . Consequently, a relation is determined by specifying whether each of the n 2 ordered pairs in A x A is in R . However, if R is reflexive, each of the n ordered pairs (a , a ) for a E A must be in R . Each of the other n(n - 1 ) ordered pairs of the form (a , b), where a =f. b, may or may not be in R . Hence, by the product rule for I counting, there are 2 n (n - ) reflexive relations [this is the number of ways to choose whether each .... element (a , b), with a =f. b, belongs to R ] . The number of symmetric relations and the number of anti symmetric relations on a set with n elements can be found using reasoning similar to that in Example 1 6 (see Exercise 45 at the end of this section). Counting the transitive relations on a set with n elements is a problem beyond the scope of this book. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be combined. Consider Examples 1 7- 19. EXAMPLE 1 7 Let A = { l , 2, 3 } and B = { I , 2, 3 , 4 } . The relations R I {(1 , 1 ), ( 1 , 2), ( 1 , 3), ( 1 , 4)} can be combined to obtain R I U R2 R I n R2 RI - R2 R2 - R I EXAMPLE 18 = = = = = {( I , 1 ), (2, 2), (3 , 3)} and R2 = {( I , 1) , ( 1 , 2), ( 1 , 3), ( 1 , 4), (2, 2), (3 , 3)}, {(1 , I)}, {(2 , 2), (3 , 3)}, { ( 1 , 2), ( 1 , 3), ( 1 , 4)} . Let A and B be the set of all students and the set of all courses at a school, respectively. Suppose that RI consists of all ordered pairs (a , b), where a is a student who has taken course b, and R2 consists of all ordered pairs (a , b), where a is a student who requires course b to graduate. What are the relations R I U R2 , R I n R2 , R I � R2 , R I - R2 , and R2 - RI? Solution: The relation RI U R2 consists of all ordered pairs (a , b), where a is a student who either has taken course b or needs course b to graduate, and RI n R2 is the set of all ordered pairs (a , b), where a is a student who has taken course b and needs this course to graduate. Also, R I � R2 consists of all ordered pairs (a , b), where student a has taken course b but does not need it to graduate or needs course b to graduate but has not taken it. R I - R2 is the set of ordered pairs (a , b), where a has taken course b but does not need it to graduate; that is, b is an elective course that a has taken. R2 - RI is the set of all ordered pairs (a , b), where b is a .... course that a needs to graduate but has not taken. EXAMPLE 19 Let R I be the "less than" relation on the set of real numbers and let R2 be the "greater than" relation on the set of real numbers, that is, RI = {(x , y) I x < y } and R2 = {(x , y) I x...
View Full Document

  • Spring '17
  • tu
  • Math, Computer Science, Sets, Binary relation, Transitive relation, relation, n-ary Relations

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture