Relation: Learning Outcomes
Relation: Learning Outcomes
l RELATION
CHAPTER 2 Relation
LE AR NI NG OUTCOMES
By the end of this chapter, you should be able to:
i. 25
RELATION l CHAPTER 2
INTRODUCTION
The relation concept is similar to the ‘family tree’. One member of the family is possibly
related to members of another family.
Source: http://www.personalized-creations.com/Family_Tree_Of_Life-3-d-Lg.jpg
http://www.theartfulstencil.com/images/FAML01family-tree-1-3.jpg
The mathematical notion of a relation such as the set theory is very general. It is one of
the key concepts of mathematics and the examples of relations occur throughout the subject.
Three special types of relation that are particularly important will be discussed in this
chapter: relation, digraph, equivalence relations, and order relations. We begin with
a look at the general concept of a relation and the various ways of visualizing relations.
The first important thing to describe a relation is a set; namely a set of ordered pairs.
If is a relation from to, we say that a ∈ A is related to b ∈ B if (a, b) ∈ R. Therefore, the
26
CHAPTER 2 l RELATION
For the most part, we shall adopt the commonly used notation and write (a R b) to denote ‘a
is related to b’ and (a b) to denote (a, b) ∉ R or ‘a is not related to b’. If we define A = B,
then it will also refer to R as a relation on A.
Example 2.1a
Let A={cities of the world}, B={countries of the world} and R={(a,b): a is the
capital city of b}. Thus, (a R b) denotes ‘a is the capital city of b’. Examples are:
(Paris) R (France), (Moscow) R (Russia), (Tirana) R (Albania), etc. Also we
have:(London) (Zimbabwe), (Naples) (Italy), (New York) (United States),
etc.
Let A=B={1,2,3,4,5,6} and R={(a,b): a divides b}. Since R consists a small finite
set, we can list the elements of the relation. R={(1, 1), (1, 2), (1, 3), (1, 4), (1,
5), (1, 6), (2, 2), (2, 4), (2, 6), (3, 3), (3, 6), (4, 4), (5, 5), (6, 6) }. We can
represent R diagrammatically as shown in Figure 2.1 by plotting its elements on
the coordinate grid diagram of the Cartesian product A×B=A2.
A×A
7
A 4
1
2 3 4 5 6
A
i. 27
RELATION l CHAPTER 2
Example 2.1b
i) Let A=B=Z+, the set of positive integers, and let (a R b) denote ‘a has the
same parity as b’; that is, either a and b are both even or they are both odd.
More precisely, R={(a,b): a–b is an integer multiple of 2. Thus,
1 R 1, 1 R 3, 1 R 5,…
2 R 2, 2 R 4, 2 R 6,…
3 R 1, 3 R 3, 3 R 5,…
R 2, 4 R 4, 4 R 6,…
ii) A picture for this relation is shown in Figure 2.2, where again we have plotted
the elements of R on the diagram for A×B.
Z+ × Z+
7
Z+ 4
1
1 2 3 4 5
Z+
There are various ways of representing relations visually, particularly relations between fi-
nite sets. In Figure 2.1 and Figure 2.2, the elements of R are marked on the coordinate grid
diagram of the Cartesian product A × B. It shows clearly R as a subset of A × B, but not
so good at showing the additional properties of the relation.
Alternatively, the finite sets are used to represent A and B as two side-by-side Venn dia-
grams with the elements arranged vertically as shown in Figure 2.3. An arrow is drawn from
(a ∈ A) to (b ∈ B) whenever (a R b). We refer to this as the arrow in Figure 2.3 as a
diagram of the relation. For example, the arrow diagram for the relation defined
in the Example 2.1b (ii) above is given in Figure 2.3.
28
CHAPTER 2 l RELATION
A directed arrow is still drawn from a to b if and only if a R b as shown in Figure 2.4
below. It shows an example of a directed graph or digraph and is called the directed graph
of the relation. If two elements a and b are such that (a R b) and (b R a), we will
usually connect their points in the directed graph by a single bi-directional arrow,
rather than two directed arrows. Further details of graph theory are discussed in Chapter 12.
6
5
2 3
A third way to represent a relation is by a ‘binary matrix’. Let A = {a1, a2, ..., an} and B =
{b1, b2, ..., bn} be finite sets and let R be a relation from A to B. We defined the binary
matrix of R as a rectangular array of zeros and ones with n rows and m columns. The
rows correspond to the elements of A (in the order listed above) and the columns correspond
to the elements of B (again, in the order listed above) as shown in Figure 2.5. At the
intersection of the ith row jth column, we place a one if (ai R bj) or a zero if (ai bj).
i. 29
RELATION l CHAPTER 2
a1=1 1 1 1 1 1 1
a2=2 0 1 0 1 0 1
a3=3 0 0 1 0 0 1
a4=4 0 0 0 1 0 0
a5=5 0 0 0 0 1 0
a6=6 0 0 0 0 0 1
For example, the binary matrix representing the relation R on A = {1, 2, 3, 4, 5, 6} given
by (a R b) if and only if a divides b is shown in Figure 2.5 for Example 2.1b (ii).
0 0 0 0 0 1 1 1 1 1
1 0 1 0 1 0 0 0 0 0
MR = and, MS =
1 1 0 1 0 1 1 1 0 0
1 1 1 0 1 1 0 0 1 1
1 0 0 1 0 0 0 0 0 0
Variable
30
CHAPTER 2 l RELATION
3. A relation R between the sets A = {1, 2, 3} and B = (A) = {Ø, {1}, {2},
{3}, {1, 2}, {2, 3}, {1, 3}, {1, 2, 3}} has the following binary matrix.
(The rows and columns of the matrix correspond to the elements of
A and B as they are listed respectively).
0 1 0 0 1 0 1 1
0 0 1 0 1 1 0 1
0 0 0 1 0 1 1 1
Let we define R as a relation of the domain X with the range Y. So R is a set of pairs (x, y)
where x is an element of X and y is an element of Y. The inverse relation R−1 of R is the
set pairs (y, x) which are obtained from the pairs (x, y) in R by interchanging x and y.
If R = {(1, r), (1, s), (3, s)}, then R−1= {(r, 1), (s, 1), (3, s)}. If R is the relation {(x, y): y is the
husband of x}, then R−1 is the relation {(x, y): y is the wife of x}. If R is the relation {(x, y): y is
the cousin of x} or R is the relation {(x, y): x² + y²}, then R−1= R.
Inverse should not be confused with complement: For instance, if R is the relation “being
a son or daughter of”, then R−1 is the relation “being a parent of”.
i. 31
RELATION l CHAPTER 2
Types of2.2
Example Data Definition
Let us consider the relation R = {(2, 3), (4, 5), (1, 5), (3, 4)}.
Therefore, the inverse relation is the set R- 1 = {(3, 2), (5, 4), (5, 1), (4, 3)}.
Let us also notice that the domain of R = {2, 4, 1, 3} and the range of R = {3, 5, 4}
but the domain of R- 1 = {3, 5, 4} and the range of R- 1 = {2, 4, 1, 3}.
Given a relation R from a set A to set B, its inverse relation R−1 is the relation
from B to A defined by
(a) Let A = {1, 2, 3, 4} and let R be the relation on the A defined by R = {(1,
2), (1, 4), (2, 2), (2, 3), (3, 4), (4, 3), (4, 4)}
i. List the elements of R−1.
ii. Draw the directed graphs of both R and R−1.
iii. Write down the binary matrices of both R and R−1.
32
CHAPTER 2 l RELATION
The notation (S º R) may be read as “S composed with R” or “S circle R”. The relation S to R
is only defined if the types of S and R match up. For example, we can define the set
grandparent = parent º parent by:
Example 2.3a
Let R = {(1, 2), (2, 3), (3, 4), (4, 1)}, S = {(1, 2), (2, 1), (3, 4), (4, 3)}
Then;
Example 2.3b
If R is the relation “to be the father of”, and S is the relation “to be married to”, then
S R is the relation “to be the father in law of”.
i. 33
RELATION l CHAPTER 2
Example 2.3c
Let A={1,2,3}, B={x,y}, and C={ , , , }, and let the relations R A×B and
S B×C be given by
R={(1,x),(1,y),(3,x)}
S={(x, ),(x, ),(y, ),(y, )}
Then
Since
In order to prove that a relation R on a set A will satisfy one of these four properties,
we need to show that the appropriate property is satisfied by an arbitrary element
or elements of A. For example, to prove that R is symmetric, we need to show that
(a R b) → (b R a), for arbitrary elements a, b ∈ A. In order to show that R does not
satisfy one of the properties, we need to find a particular element or elements of A
that show this. For example, to show that R is not symmetric, we need to find
particular elements a, b ∈ A such that (a R b) but (b a).
34
CHAPTER 2 l RELATION
Example 2.4a
Example 2.4a
(x R y) if and only if x y
Then;
Example 2.4b
Let A= Z+×Z+ and R be the relation on A defined by (a,b) R (c,d) if and only if
((a+d)=(b+c) ). Your task is to show that R is reflexive, symmetric, and
transitive, but not anti-symmetric. The solution,
a+d+c+f=b+c+d+e
So
a+f=b+e
Which means that (a,b) R (e,f). Therefore (a,b) R (c,d) and (c,d) R (e,f) implies
that (a,b) R (e,f), so R is transitive.
i. 35
RELATION l CHAPTER 2
Example 2.4c
Let A = {a,b,c,d} and R = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (b, d), (d, d)}.
Then;
i. R is not reflexive since (c R c); therefore it is not true that (x R x) for every
x A;
ii. R is not symmetric since, for example, (a R c) but (c R a);
iii. R is not anti-symmetric since (a R b) and (b R a) but a b;
iv. R is not transitive since (a R b) and (b R d) but (a R d).
Example 2.4d
Consider the directed graph given in Figure 2.6 of a relation R on the set A
= {a, b, c, d, e}.
A
E
B
D
36
CHAPTER 2 l RELATION
Example 2.4e
A relation R on a four-elements set A has the following binary matrix:.
1 0 1 0
A= 1 1 0 0
0 0 1 1
0 1 0 1
Which of the properties does R satisfy? Solution,
i. Firstly, it is clear that R is reflexive since there are only ones along the
leading diagonal.
ii. R is not symmetric because the matrix is not symmetric about the leading
diagonal. In our case, there is a one in row 1, column 3, but a zero in row
3, column 1.
iii. R is anti symmetric; except for the leading diagonal wherever a one
appears in row i, column j, a zero appears in row j, column i. Note that
sometimes the value of zero may appear in both these places, for example,
in row 1, column 4 and row 4, column 1.
iv. R is not transitive. If we label the elements of the set a1,a2,a3,a4, in that
order, then a1 R a3 and a3 R a4 but a1 R a4. We leave it as an exercise to
discover whether there are any other counter-example to transitivity.
(a) R = {(a, a), (b, b), (c, c), (d, d), (e, e), (a, b), (b, c)}
(b) R = {(a, a), (a, d), (b, b), (c, c), (d, d), (d, e), (e, a), (e, e)}
i. 37
RELATION l CHAPTER 2
2.5 Digraph
In the case where R is a binary relation on A, we can also use a directed graph or digraph,
which consists of a set of nodes corresponding to the elements in A, joined by arrowed lines
indicating the relationship between the elements. For example, let A = {a1, a2, a3, a4} and R =
{(a1, a2); (a2, a1); (a3, a2); (a3, a3);}. The directed graph of this relation is shown in Figure 2.7.
A
a1
a4 a2
a3
Notice that the direction of the arrows matters. It is, of course, still possible to use
a diagram where the source and target sets are drawn separately as in Figure 2.2.
38
CHAPTER 2 l RELATION
Example 2.6a
The ‘divisibility’ relation on the set of positive integers Z+, defined by (n R m) if and
only if n divides m, is a partial order. (Note: n divides m is frequently written n / m.)
Example 2.6b
The relation on the set of English words defined by ‘the word w1 is related to the
word w2 if w1=w2 or w1 comes before w2 in a dictionary’ is a partial ordering.
Normally, the ordering of words is usually in alphabetical order.
The next theorem says that any subset of a partially ordered set is automatically a
partially ordered set. It gives a way of generating many more examples of
partially ordered sets. We include the proving of the theorem in the exercise.
Although the definition of the relation S looks somewhat technical, it is the obvious relation
on B. For b1, b2 ∈ B, we have (b1 S b2) if and only if b1 R b2. Therefore, elements of B are
related by S is exactly the same way as they are related by R, when we consider them
as elements of A. This relation S is called the restriction of R to B, and we say that
B inherits the relation S from the relation R on A.
Returning to the example of the proper subsets of {a, b, c} ordered by inclusion, we can
verify that there is no greatest element according to our definition. However, each of the
two-element subsets can be regarded as the ‘largest possible’ in the sense that there
are no subsets which are ‘bigger’ than these. We formalise this idea in the definition of
‘maximal’ elements.
i. 39
RELATION l CHAPTER 2
Example 2.6c
Consider again the proper subsets of {a,b,c} ordered by inclusion. In this case,
there are three different maximal elements {a,b}, {b,c}, and {a,c}. There is a
single minimal element, namely the least element Ø.
Example 2.6d
Note that, with this ordering, A has no greatest or least element. Clearly, the only
candidates for a least element are the minimal elements, none of which is the
least element. For example, since (2 3) it is not true that (2 R a) for every
(a A), so 2 is not the least element. Also (3 2), (5 2) and (7 2) so neither 3
nor 5 nor 7 is the least element. Similar remarks apply to the maximal elements,
so there is no greatest element.
We have seen that a partially ordered set may have several minimal and/or maximal
elements. It can, however, have at most one greatest element and at most one least
element. That is, if a poset A has a greatest element α, then α is unique; and similarly for
a least element β. (We have, in fact, been tacitly assuming this by referring to the greatest
and least elements.) It is easy to see, for example, that A has at most one least element:
suppose β and β’ are two least elements. Then (β R β’) since β is a least element, and
(β’ R β), since β’ is a least element. Therefore, (β = β’) (by anti-symmetry), so there is only
one least element. The same kind of argument clearly works for the greatest element as well.
40
CHAPTER 2 l RELATION
The following theorem clarifies the connection between least and minimal elements and
between greatest and maximal elements.
We prove the proposition for the greatest element only; the proof for the least element is
similar.
Let α be the greatest element and suppose (α R a) where a ∈ A. Since α is the greatest
element, we also know that (a R α). Therefore (a = α), by the anti-symmetric property, so
α is a maximal element.
Suppose, now, that x is a maximal element. Since α is the greatest element, we have (x R α).
By the maximal property of x, this implies (x = α), so α is the only maximal element.
We have seen that, in a partially ordered set, there may be elements a and b such that
neither (a R b) nor (b R a). For our most familiar order relation, ≤ on ℝ, this cannot occur.
A partial order such as this, where every pair of elements is related (at least one way round),
is called a ‘total order’.
A total order (or linear order) on a set A is a partial order R which satisfies
the following dichotomy law. For every pair a, b A, either (a R b) or (b R a)
(or both).
Note that there is a certain amount of redundancy in the definition of a total order,
in that the reflexive condition (which is included in the statement that R is a partial
order) follows from the dichotomy law. This is because if we let b = a, then this
last condition implies (a R a) for every a ∈ A. Thus, a total order could be defined
slightly more efficiently as a relation which is anti-symmetric, transitive, and
satisfies the dichotomy law.
i. 41
RELATION l CHAPTER 2
Example 2.6e
The relation on R is a total order. Any subset of a totally ordered set is also
totally ordered by the same relation (exercise: prove this). Thus the relation is a
total order on any set of real numbers.
Example 2.6f
Let R be the relation on R2 defined by (x1,y1) R (x2,y2) if and only if (x1 x2) and
(y1 y2). Again, we leave it as an exercise to show that R is a partial order. It is
not, however, a total order because, for example, (0,1) and (1,0) are not related.
2. Show that the relation R on the plane ℝ² defined by (x1, y1) R (x2, y2)
if and only if (x1 ≤ x2) and (y1 ≤ y2) is a partial order.
5. Let A be a poset with order relation R, and let a1, a2, ..., an be elements of
such that (a1 R a2), (a2 R a3),..., (an-1 R an), (an R a1). Show that a1 = a2 = ... =
an.
42
CHAPTER 2 l RELATION
One of the most important types of relation is an equivalence relation on a set. In this sec-
tion, we define the notion of an equivalence relation and explore the close connection
between equivalence relations and partitions of a set.
Consider the relation R on the set of living people defined by: (x R y) if and only if x
resides in the same country as y. Assuming each person is resident in only one country,
the relation satisfies three obvious properties:
i. x resides in the same country as x; that is, R is reflexive;
ii. if x resides in the same country as y, then y resides in the same country as x; that is,
R is symmetric;
iii. if x resides in the same country as y, and y resides in the same country as z, then
x resides in the same country as z; that is, R is transitive.
Any given element x is related to everyone who lives in the same country as x and to
no one else. Therefore, the relation subdivides the set of living people into subsets
according to their countries of residence. This is an example of an equivalence relation,
which we now define formally.
Example 2.7a
Then;
i. 43
RELATION l CHAPTER 2
Example 2.7b
Let A=R2-{(0,0)}, the set of points in the plane except the origin, and define a
relation R on A by ((a,b) R (c,d)) if and only if (a,b) and (c,d) both lie on the same
straight line through the origin.
Clearly, R is both reflexive and symmetric. Also, it is not difficult to see that R is
transitive: if (a,b) and (c,d) both lie on the same straight line through the origin,
and similarly (c,d) and (e,f) both lie on the same straight line through the origin,
then so, too, do (a,b) and (e,f). Therefore, R is an equivalence relation.
Example 2.7c
Let A=Z, the set of integers, and define a relation R on A by (n R m) if and only if
n=2k m for some integer k. Show that R is an equivalence relation. Solution is,
Thirdly, suppose (n R m) and (m R p); then there exist integers k and l such that
n=2k m and m=2l p. Combining these two equations gives n=2k 2l p=2k+pp where
k+l is an integer. Thus, (n R m) and (m R p) implies (n R p), so R is transitive.
Example 2.7d
44
CHAPTER 2 l RELATION
[x] = {y A: (x R y)}
Example 2.7e
[1] = {1, 3, 5, 7, 9, . . .}
[2] = {2, 4, 6, 8, 10, . . .}
[3] = {1, 3, 5, 7, 9, . . .}
[4] = {2, 4, 6, 8, 10, . . .} etc.
In this example, there are clearly only two different equivalence classes—the sets of
even and odd positive integers respectively. Note that these two equivalence classes
form a partition of Z+.
Example 2.7f
[n]={n,-n}.
There is one exception: since 0 equals its negative, the equivalence class of 0
contains only itself, [0] = {0}.
i. 45
RELATION l CHAPTER 2
3. A relation R on ℤ+ × ℤ- is defined by
5. How many different equivalence relations are there on the sets (i)
{a, b, c}, and (ii) {a, b, c, d}?
46
CHAPTER 2 l RELATION
SUMMARY
• inverse relation,
• composition of relations,
• relation on a set,
• digraph,
• partial order, and
• equivalence relation.
Glossary
R- inverse relation of R
Ø empty set
i. 47
RELATION l CHAPTER 2
REFERENCES
Bernard K., & Robert, C. B. (1987). Discrete Mathematical Structure for Computer
Science. New Jersey, USA: Prentice Hall, Inc. Englewood Cliffs.
Garnier, R., Taylor, J. (2001). Discrete Mathematics for New Technology. United
Kingdom: Institute of Physics Publishing.
Rosen, K. H. (1999). Discrete mathematics and its applications. New York: McGraw-
Hill.
48