Lesson 9
Lesson 9
Lesson 9 - Relations
Learning Outcomes
By the end of this lesson, students will be able to;
9.1 Introduction
In many naturally occurring phenomena, two variables may be related with some kind of
relationship. For instance, a teacher wants to find whether the study time of a student affects
the marks of the students at the examination. Table 9.1 shows a correspondence between study
time and the marks.
Each data point from the above table may be represented as an ordered pair. In this case,
the first value represents the study time and the second, the marks. The set of ordered pairs
{(3, 60), (2, 80), (1, 55), (5, 100), (4, 90)} defines a relation between study time and marks.
Any set of ordered pairs (x, y) is called a relation in x and y. Furthermore,
• The set of first components in the ordered pairs is called the domain of the relation.
• The set of second components in the ordered pairs is called the range of the relation.
The symbol R is used to denote the relation and its negation is represented by 6R. For
instance, (3, 60) ∈ R; we then say “3 is R-related to 60”, written 3R60.
1
2 ITE 1812 - Mathematic for IT
Remark 9.1.
• A relation may consist of a finite number of ordered pairs or an infinite number of ordered
pairs.
• The x and y components that constitute the ordered pairs in a relation do not need to be
numerical.
Example 9.1
(x, y) ∈ R if x divides y,
we obtain
R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)} .
Example 9.2
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)} .
Example 9.3
(x, y) ∈ R if x divides y,
we obtain
R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)} .
The inverse of this relation is
R−1 = {(4, 2), (6, 2), (3, 3), (6, 3), (4, 4)} .
2
Degree of Bachelor of Information Technology 3
Example 9.4
The composition of the relations
R1 = {(1, 2), (1, 6), (2, 4), (3, 4), (3, 6), (3, 8)}
and
R2 = {(2, u), (4, s), (4, t), (6, t), (8, u)}
is
R2 ◦ R1 = {(1, u), (1, t), (2, s), (2, t), (3, s), (3, t), (3, u)} .
Remark 9.2. Let R be a relation on the set X. The powers Rn , n = 1, 2, 3, . . . , are defined
recursively by
R1 = R and Rn+1 = Rn ◦ R.
Example 9.5
R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)} ,
R2 = {(1, 1), (1, 2), (2, 1)} ,
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)} ,
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)} ,
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)} ,
R6 = {(3, 4)} .
3
4 ITE 1812 - Mathematic for IT
Discuss reflexive, symmetric, transitive and antisymmetric properties of the above rela-
tions.
Solution.
The relations R3 and R5 are reflexive because they both contain all pairs of the form
(x, x), 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, R1 , R2 , R4 and R6 are not
reflexive because (3, 3) is not in any of these relations.
The relations R2 and R3 are symmetric, because in each case (b, a) belongs to the
relation whenever (a, b) does. For R2 , the only thing to check is that both (2, 1) and
(1, 2) are in the relation. For R3 , it is necessary to check that both (1, 2) and (2, 1)
belong to the relation and (1, 4) and (4, 1) belong to the relation. The relations R1 , R5
and R6 are not symmetric, because (3, 4) is in the rations but (4, 3) is not in any of
these relations. However (4, 3) is in the ration R4 but (3, 4) is not in the relation R4 .
Therefore R4 is not symmetric.
R4 , R5 and R6 are all antisymmetric. For each of these relations there is no pair of
elements x and y with x 6= y such that both (x, y) and (y, x) belong to the relation. The
relations R1 , R2 and R3 are not antisymmetric, because (1, 2) in the relation with 1 6= 2.
such that (1, 2) and (2, 1) are both in the relation.
R4 , R5 and R6 are transitive. For each of these relations, we can show that it is transitive
by verifying that if (x, y) and (y, z) belong to this relation, then (x, z) also does. For
instance, R4 is transitive, because (3, 2) and (2, 1), (4, 2) and (2, 1), (4, 3) and (3, 1), and
(4, 3) and (3, 2) are the only such sets of pairs and (3, 1), (4, 1) and (4, 2) belong to R4 .
Similarly, by comparing all the pairs we can verify the transitive property of the relations
R5 and R6 . R1 is not transitive because (3, 4) and (4, 1) belong to R1 , but (3, 1) does
not. R2 is not transitive because (2, 1) and (1, 2) belong to R2 , but (2, 2) does not. R3 is
not transitive because (4, 1) and (1, 2) belong to R3 , but (4, 2) does not.
Example 9.6
Consider the relation
R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1), (5, 3), (5, 5)} ,
4
Degree of Bachelor of Information Technology 5
Solution.
The relation is reflexive because (1, 1), (2, 2), (3, 3), (4, 4), (5, 5) ∈ R. The relation is
symmetric because whenever (x, y) is in R, (y, x) is also in R. Finally, the relation is
transitive because whenever (x, y) and (y, z) are in R, (x, z) is also in R. Since R is
reflexive, symmetric and transitive, R is an equivalence relation on {1, 2, 3, 4, 5}.
The general idea behind an equivalence relation is that it is a classification of objects which
are in some way “alike”. The two elements x and y that are related by an equivalence relation
are called equivalent. The notation x ∼ y is often used to denote that x and y equivalent
elements with respect to a particular equivalence relation.
Let R be an equivalence relation on a set X. For each a ∈ X, the sets [a] defined as
[a] = {x ∈ X | xRa} ,
Example 9.7
Find the equivalence classes for the equivalence relation
R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1), (5, 3), (5, 5)} ,
on {1, 2, 3, 4, 5}.
Solution.
In Example 2.6, we showed that the relation
R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1), (5, 3), (5, 5)} ,
5
6 ITE 1812 - Mathematic for IT
In other words, ref lexive(R) is obtained by simply adding to R those elements (x, x) in the
diagonal which do not already belong to R and symmetric(R) is obtained by adding to R all
pairs (y, x) whenever (x, y) belongs to R.
Example 9.8
Find the reflexive closure and the symmetric closure of the relation
R = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)} on the set X = {1, 2, 3, 4}.
Solution.
The reflexive closure of R is
ref lexive(R) = R ∪ {(2, 2), (4, 4)} = {(1, 1), (1, 3), (2, 2), (2, 4), (3, 1), (3, 3), (4, 3), (4, 4)} .
The symmetric closure of R is
symmetric(R) = R∪{(4, 2), (3, 4)} = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (3, 4), (4, 2), (4, 3)} .
6
Degree of Bachelor of Information Technology 7
i=1
9.2 Theorem: Let R∗ is the transitive closure of R. Suppose X is a finite set with n
elements. Then
R∗ = R ∪ R2 ∪ . . . · · · ∪ Rn .
transitive(R) = R ∪ R2 ∪ . . . · · · ∪ Rn .
Example 9.9
Find the transitive closure of the relation R = {(1, 2), (2, 3), (3, 3)} on X = {1, 2, 3}.
Solution.
The transitive closure of the relation R, since X has three elements, is obtained by taking
the union of R with R2 = R ◦ R and R3 = R2 ◦ R. Note that
and
R3 = R2 ◦ R = {(1, 3), (2, 3), (3, 3)} .
Hence,
transitive(R) = R ∪ R2 ∪ R3 = {(1, 2), (1, 3), (2, 3), (3, 3)} .
Definition 9.7
Let X1 , X2 , . . . , Xn be sets. An n-ary relation on these sets is a subset of X1 ×X2 ×· · ·×Xn .
The sets X1 , X2 , . . . , Xn are called the domains of the relation and n is called its degree.
7
8 ITE 1812 - Mathematic for IT
Example 9.10
Let R be the relation on N × N × N consisting of triples (x, y, z), where x, y and z are
integers with x < y < z. Then (1, 2, 3) ∈ R, but (2, 4, 3) ∈
/ R. The degree of this relation
is 3. Its domains are all equal to the set of natural numbers.
Self-Assessment Exercises
1. Given A = {1, 2, 3, 4}. Consider the following relation in A:
R = {(1, 1), (2, 2), (2, 3), (3, 2), (4, 2), (4, 4)} .
R = {(1, 1), (1, 2), (2, 3), (3, 1), (3, 3)} , S = {(1, 2), (1, 3), (2, 1), (3, 3)} .
Find
(a) R ∪ S, R ∩ S and RC .
(b) R ◦ S.
(c) S 2 = S ◦ S.
3. Consider the relation R = {(a, a), (a, b), (b, c), (c, c)} on the set A = {a, b, c}.
Find
Suggested Reading
Chapter 7: Kenneth Rosen, (2011) Discrete Mathematics and Its Applications, 7th Edition,
McGraw-Hill Education.