Properties of Cartesian Relations
Properties of Cartesian Relations
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.
The most direct way to express a relationship between elements of two sets is to use ordered pairs
made up of two related elements.
Definition 9.1
Let A and B be sets. A binary relation from A to B is a subset of A × B.
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 R b to denote that
(, b) ∈ R and R b to denote that (, b) ∈
/ R. Moreover, when (, b) belongs to R, is said to be
related to b by R.
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 9.1.
EXAMPLE 1
Let A = {0, 1, 2} and B = {, b}. Then {(0, ), (0, b), (1, ), (2, b)} is a relation from A to B. This
means, for instance, that 0 R , but that 1 R
b.
Figure 9.1. Displaying the Ordered Pairs in the Relation R from Example 1
Definition 9.2
A relation on a set A is a relation from A to A.
Solution: Because (, b) is in R if and only if and b are positive integers not exceeding 4 such that
divides b, we see that
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
Figure 9.2. Displaying the Ordered Pairs in the Relation R from Example 2
EXAMPLE 3
Consider these relations on the set of integers:
R1 = {(, b) | ≤ b},
R2 = {(, b) | > b},
R3 = {(, b) | = b or = −b},
R4 = {(, b) | || = |b|},
R5 = {(, b) | = b + 1},
R6 = {(, b) | | + b| ≤ 3}.
Which of these relations contains each of the pairs (1, 1), (1, 2), (2, 1), (1, −1) and (2, 2)?
Solution: The pair (1, 1) is in R1 , R3 , R4 , and R6 ; (1, 2) is in R1 and R6 ; (2, 1) is in R2 , R5 , and R6 ;
(1, −1) is in R2 , R3 , and R6 ; and finally, (2, 2) is in R1 , R3 , and R4 .
Definition 9.3
A relation R on a set A is called reflexive if (, ) ∈ R for every element ∈ A.
EXAMPLE 4
Consider the following relations on {1, 2, 3, 4}:
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)}.
The relations R3 and R5 are reflexive because they both contain all pairs of the form (, ), 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.
Definition 9.4
A relation R on a set A is called symmetric if (b, ) ∈ R whenever (, b) ∈ R, for all , b ∈ A.
EXAMPLE 5
Consider the following relations on {1, 2, 3, 4}:
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)}.
Definition 9.5
A relation R on a set A such that for all , b ∈ A, if (, b) ∈ R and (b, ) ∈ R then = b is called
antisymmetric.
EXAMPLE 6
Consider the following relations on {1, 2, 3, 4}:
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)}.
R4 , R5 , and R6 are all antisymmetric. For each of these relations there is no pair of elements and
b with ̸= b such that both (, b) and (b, ) belong to the relation. The reader should verify that none
of the other relations is antisymmetric. This is done by finding a pair (, b) with ̸= b such that (, b)
and (b, ) are both in the relation.
Definition 9.6
A relation R on a set A is called transitive if whenever (, b) ∈ R and (b, c) ∈ R, then (, c) ∈ R,
for all , b, c ∈ A.
EXAMPLE 7
Consider the following relations on {1, 2, 3, 4}:
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)}.
Definition 9.7
Four fundamental set operations applied to two relations, R1 and R2 . Since relations are sets of
ordered pairs, these are standard set theory operations.
R1 R2
Union (R1 ∪ R2 )
R1 R2
Intersection (R1 ∩ R2 )
R1 R2
Difference (R1 − R2 )
R1 R2
Difference (R2 − R1 )
R1 R2
EXAMPLE 8
Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The relations R1 = {(1, 1), (2, 2), (3, 3)} and R2 =
{(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to obtain
R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)},
R1 ∩ R2 = {(1, 1)},
R1 − R2 = {(2, 2), (3, 3)},
R2 − R1 = {(1, 2), (1, 3), (1, 4)}.
Solution:
Definition 9.8
Let R be a relation from a set A to a set B and S a relation from B to a set C. The composite of
R and S is the relation consisting of ordered pairs (, c), where ∈ A, c ∈ C, and for which there
exists an element b ∈ B such that (, b) ∈ R and (b, c) ∈ S. We denote the composite of R and
S by S ◦ R.
R : (, b) b S : (b, c) c
S ◦ R : (, c)
EXAMPLE 9: What is the composite of the relations R and S, where R is the relation from {1, 2, 3} to
{1, 2, 3, 4} with
R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)}
and S is the relation from {1, 2, 3, 4} to {0, 1, 2} with
S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)} ?
Solution:
B = {1, 2, 3, 4}
A = {1, 2, 3}
C = {0, 1, 2}
1
1 0
2
2 1
3
3 2
4
S ◦ R is constructed using all ordered pairs in R and ordered pairs in S, where the second element
of the ordered pair in R agrees with the first element of the ordered pair in S. For example, the ordered
pairs (2, 3) in R and (3, 1) in S produce the ordered pair (2, 1) in S ◦ R. Computing all the ordered pairs
in the composite, we find
S ◦ R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}.
Definition 9.9
Let R be a relation on the set A. The powers Rn , n = 1, 2, 3, . . ., are defined recursively by
R1 = R and R n+1 = Rn ◦ R.
R2 = R ◦ R, R3 = R2 ◦ R = (R ◦ R) ◦ R, and so on.
EXAMPLE: Let
R = {(1, 1), (2, 1), (3, 2), (4, 3)}.
Find the powers Rn , n = 2, 3, 4, . . ..
Solution:
R R R R
Set A Set A Set A Set A Set A
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
Furthermore, because R3 = R2 ◦ R,
EXERCISE
1. List the ordered pairs in the relation R from
2. For each of these relations on the set {1, 2, 3, 4}, decide whether it is reflexive, whether it is sym-
metric, whether it is antisymmetric, and whether it is transitive.
a) {(2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}
b) {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
c) {(2, 4), (4, 2)}
d) {(1, 2), (2, 3), (3, 4)}
e) {(1, 1), (2, 2), (3, 3), (4, 4)}
f) {(1, 3), (1, 4), (2, 3), (2, 4), (3, 1), (3, 4)}
Definition 9.10
A relation R on the set A is irreflexive if for every ∈ A, (, ) ∈
/ R. That is, R is irreflexive if no
element in A is related to itself.
Definition 9.11
A relation R is called asymmetric if (, b) ∈ R implies that (b, ) ∈
/ R.
Definition 9.12
Let R be a relation from a set A to a set B.
The inverse relation from B to A, denoted by R−1 , is the set of ordered pairs
R = {(, b) | (, b) ∈
/ R}.
8. Let R be the relation on the set {1, 2, 3, 4, 5} containing the ordered pairs
R = {(1, 1), (1, 2), (1, 3), (2, 3), (2, 4), (3, 1), (3, 4), (3, 5), (4, 2), (4, 5), (5, 1), (5, 2), (5, 4)}.
Find:
a) R2
b) R3
c) R4
d) R5
There are many ways to represent a relation between finite sets. One way is to list its ordered pairs.
Another way to represent a relation is to use a table. In this section we will discuss the alternative
methods for representing relations using zero–one matrices.
R 1 2
1 0 0
2 1 0
3 1 1
Figure 1. The Zero–One Matrix for a Reflexive Relation. (Off–diagonal elements can be 0 or 1.)
The relation R is symmetric if (, b) ∈ R implies that (b, ) ∈ R. Consequently, the relation R on
the set A = {1 , 2 , . . . , n } is symmetric if and only if (j , ) ∈ R whenever ( , j ) ∈ R.
In terms of the entries of MR , R is symmetric if and only if mj = 1 whenever mj = 1. This also
means mj = 0 whenever mj = 0. Consequently, R is symmetric if and only if
Recalling the definition of the transpose of a matrix from Section 2.6, we see that R is symmetric if
and only if
MR = (MR )T ,
that is, if MR is a symmetric matrix.
The form of the matrix for a symmetric relation is illustrated in Figure 2(a).
The relation R is antisymmetric if and only if (, b) ∈ R and (b, ) ∈ R imply that = b.
Consequently, the matrix of an antisymmetric relation has the property that if mj = 1 with ̸= j,
then mj = 0. In other words, either mj = 0 or mj = 0 when ̸= j.
The form of the matrix for an antisymmetric relation is illustrated in Figure 2(b).
1 1 0 1 0 0
(a) Symmetric: MR =
1 1 0
(b) Antisymmetric: MR =
0 1 0
0 0 1 0 0 1
Example 4 Suppose that the relations R1 and R2 on a set A are represented by the matrices
1 0 1 1 0 1
M R1 =
1 0 0
and M R2 =
0 1 1 .
0 1 0 1 0 0
What are the matrices representing R1 ∪ R2 and R1 ∩ R2 ?
Solution: The matrices of these relations are
1 0 1
MR1 ∪R2 = MR1 ∨ MR2 =
1 1 1,
1 1 0
1 0 1
MR1 ∩R2 = MR1 ∧ MR2 =
0 0 0.
0 0 0
We now turn our attention to determining the matrix for the composite of relations. This matrix can
be found using the Boolean product of the matrices these relations.
In particular, suppose that R is a relation from A to B and S is a relation from B to C. Suppose that
A, B, and C have m, n, and p elements, respectively.
Let the zero–one matrices for S◦R, R, and S be MS◦R = [tj ], MR = [rj ], and MS = [sj ], respectively
(these matrices have sizes m × p, m × n, and n × p, respectively).
The ordered pair ( , cj ) belongs to S ◦ R if and only if there is an element bk such that ( , bk )
belongs to R and (bk , cj ) belongs to S. It follows that tj = 1 if and only if rk = skj = 1 for some k.
From the definition of the Boolean product, this means that
MS◦R = MR ⊙ MS .
Example. Find the matrix representing the relation S◦R, where the matrices representing R and S are
0 0 0 0 1 0
MR = 1 0 1 , M S = 0 0 1 .
1 1 0 1 0 1
The matrix representing the composite of two relations can be used to find the matrix MnR . In particular,
[n]
MnR = MR ,
from the definition of Boolean powers.
Example
Find the matrix representing the relation R2 , where the matrix representing R is
0 1 0
MR = 0 1 1.
1 0 0
EXERCISES
1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in
increasing order).
a) {(1, 1), (1, 2), (1, 3)}
b) {(1, 2), (2, 1), (2, 2), (3, 3)}
c) {(1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}
d) {(1, 3), (3, 1)}
2. List the ordered pairs in the relations on {1, 2, 3} corresponding to these matrices (where the rows
and columns correspond to the integers listed in increasing order).
(a)
0 1 0
1 0 1
1 0 1
(b)
0 1 0
0 1 0
0 1 0
(c)
1 1 1
1 0 1
1 1 1
3. How many nonzero entries does the matrix representing the relation R on A = {1, 2, 3, . . . , 100}
consisting of the first 100 positive integers have if R is
(a) {(, b) | > b} (b) {(, b) | ̸= b}
4. How can the matrix for R, the complement of the relation R, be found from the matrix representing
R, when R is a relation on a finite set A?
5. How can the matrix for R−1 , the inverse of the relation R, be found from the matrix representing R,
when R is a relation on a finite set A?
6. Let R be the relation represented by the matrix
0 1 1
MR = 1 1 0 .
1 0 1
1 0 0 1 1 1
Find the matrices that represent (a) R1 ∪ R2 (b) R1 ∩ R2 (c) R2 ◦ R1 (d) R1 ◦ R1 (e) R1 ⊕ R2
8. Let R be the relation represented by the matrix
0 1 0
MR = 0 0 1 .
1 1 0