Relations and Their Properties: ( (A, B) - A B or A B), ( (A, B) - A b+1), R ( (A, B) - A+b 3)
Relations and Their Properties: ( (A, B) - A B or A B), ( (A, B) - A b+1), R ( (A, B) - A+b 3)
Functions as relations. Recall that a function f from a set A to a set B assigns a unique 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). Since the
graph of f is a subset of A×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 ∈ B such that (a, b) ∈ R.
Relations on a set
A relation on a set A is a relation from A to A. In other words, a relation on a set A is a subset of
A× A .
Example. Let A = {1, 2, 3, 4}. Which ordered pairs are in the relation R = {(a, b) | a divides b}?
Solution: R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
Example 1. Consider the following relations on the set of integers:
R1 ={(a , b)|a≤b}, R2 ={(a , b )|a> b}, R3 ={(a , b )|a=b or a=−b},
R4 ={( a ,b )|a=b}, R5 ={(a , b )|a=b+1}, R6 ={(a , b )|a+b≤3}.
Which of these relations contain 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.
Example. How many relations are there on a set with n elements?
Solution: A relation on a set A is a subset of A× A . Since A× A has n2 elements when A has n
n2
elements, and a set with m elements has 2m subsets, there are 2 subsets of A× A . Thus, there are
2
2n relations on a set with n elements.
Properties of relations
A relation R on a set A is called reflexive if (a, a) ∈ R for every element a ∈ A .
Example 2. Consider the following relations on {1, 2, 3, 4}:
R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
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)},
Combining relations
Since relations from A to B are subsets of A×B , two relations from A to B can be combined in any
way two sets can be combined.
Example. 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 )} .
There is another way that relations are combined which is analogous to the composition of functions.
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 (a, c), where a∈ A , c∈ C , and for which there exists an
element b ∈ B such that (a , b )∈ R and (b ,c)∈ S . We denote the composite of R and S by S ∘ R .
Example. 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: 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 pair (2, 3) in R and (3, 1) in S produce the ordered pair in S. For example, the ordered
pair (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)} .
The powers of a relation R can be inductively defined from the definition of a composite of two
relations.
Let R be a relation on the set A. The powers Rn, n = 1, 2, 3, … are defined inductively by R1 = R and
3 2
R =R ∘ R . The definition shows that R =R∘ R , R =R ∘ R=( R∘ R )∘ R , and so on.
n+1 n 2
Example. Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Find the powers Rn, n = 2, 3, 4, …
2
R =R∘ R , we find that R ={(1, 1), (2, 1), (3, 1), (4 , 2)}. Furthermore, since
2
Solution: Since
3
R =R ∘ R , R ={(1, 1), (2, 1), (3, 1), (4, 1)}. Additional computation shows that R4 is the same as R3,
3 2
4
so R ={(1, 1),(2, 1),(3, 1),(4, 1)}. It is also follows that R =R for n = 5, 6, 7, …
n 3
n
Theorem 1. The relation R on a set A is transitive iff R ⊆ R for n = 1, 2, 3, …
n-ary relations
Let A1, A2, …, An be sets. An n-ary relation on these sets is a subset of 1 2
A ×A ×...× A
n . The sets A1,
A2, …, An are called the domains of the relation, and n is called its degree.
Example. Let R be the relation consisting of triples (a, b, c), where a, b and c are integers with a < b
< c. 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 integers.
Example. Let R be the relation consisting of 5-tuples (A, N, S, D, T) representing airplane flights,
where A is the airline, N is the flight number, S is the starting point, D is the destination, and T is the
departure time. For instance, if Nadir Express Airplanes has flight 963 from Newark to Bangor at
15:00, then (Nadir, 963, Newark, Bangor, 15:00) belongs to R. The degree of this relation is 5, and
its domains are the set of all airlines, the set of flight numbers, the set of cities, the set of cities
(again), and the set of times.
Representing relations using matrices
A relation between finite sets can be represented using a zero-one matrix. Suppose that R is a relation
from
A={a 1 , a2 ,.. . ,an } to B={b1 , b2 ,. .. ,b n } . The relation R can be represented by the matrix
[ ]
0 0
M R= 1 0
Solution: Since R={(2, 1},(3, 1),(3, 2)¿¿ , the matrix for R is 1 1 .
Example. Let
A={a 1 , a2 , a3 } and B={b1 , b2 ,b 3 , b 4 , b5 } . Which ordered pairs are in the relation R
[ ]
0 1 0 0 0
M R= 1 0 1 1 0
represented by the matrix 1 0 1 0 1 ?
m =1 , it follows that R = {(a , b ),
Solution: Since R consists of those ordered pairs (ai ,b j ) with ij 1 2
(a2, b1),(a2, b3), (a2, b4), (a3, b1), (a3, b3), (a3, b5)}.
Solution: The ordered pair (x, y) in the relation are R = {(1, 3),(1, 4), (2, 1),(2, 2),(2, 3), (3, 1), (3, 3),
(4, 1), (4, 3)}. Each of these pairs corresponds to an edge of the directed graph, with (2, 2) and (3, 3),
corresponding to loops.
Glossary
composite – композиция; power – степень; directed graph – ориентированный граф
vertex – вершина; edge – ребро; loop – цикл
9.10. Draw the directed graphs representing each of the relations from Ex. 9.7.
9.11. Let R be the relation on the set of people consisting of pairs (a,b) where a is a parent of b .
Let S be the relation on the set of people consisting of pairs (a,b) where a and b are siblings
(brothers or sisters). What are S ∘ R and R∘ S ?
9.12. A relation R on the set A is irreflexive if for every a ∈ A (a , a)∉ R . That is, R is irreflexive
if no element in A is related to itself.
Suppose that R and S are reflexive relations on a set A . Prove or disprove each of the following
statements: a) R∪S is reflexive; b) R∩S is reflexive; c) R ⊕ S is irreflexive; d) R−S is
irreflexive; e) S ∘ R is reflexive.
Exercise for Homework 9
9.13. List the ordered pairs in the relation R from A = {1, 2, 3, 4, 5} to B = {1, 2, 3, 4} where
(a , b )∈ R if and only if a) a + b = 4; b) a | b; c) lcm(a, b) = 2 (lcm is abbreviate for “least common
multiple”) .
9.14. Determine whether the relation R on the set of all people is reflexive, symmetric,
antisymmetric, and/or transitive, where (a , b )∈ R if and only if a) a is taller than b; b) a and b were
born on the same day; c) a has the same first name as b; d) a and b have a common grandparent.
9.15. Let R1 ={(1, 1),(1, 3),(2, 1),(2, 4),(3, 2)} and R2 ={(1, 3),(1, 4),(2, 3),(3, 2 ),(3, 3),(3, 4 )} be
relations from {1, 2, 3} to {1, 2, 3, 4}. Find a) R1 ∪R2 ; b) R1 ∩R2 ; c) R1 −R2 ; d) R2 −R1 .
9.16. Let R be the relation {(1, 1), (1, 2), (2, 2), (2, 3), (3, 2), (3, 3)}, and let S be the relation {(1, 3),
(2, 3), (2, 4), (3, 2), (3, 4), (4, 1)}. Find S ∘ R .
9.17. Which 4–tuples are in the relation {(a, b, c, d) | a, b, c and d are positive integers with abcd =
6}?
9.18. Represent each of the following relations on {1, 2, 3} with a matrix (with the elements of this
set listed in increasing order): a) {(1, 2), (2, 1), (2, 2), (3, 3)}; b) {(1, 3), (3, 1)}.
9.19. List the ordered pairs in the relations on {1, 2, 3, 4} corresponding to the following matrices
(where the rows and columns correspond to the integers listed in increasing order).
[ ][ ][ ]
1 0 0 1 0 1 0 1 1 1 1 1
0 1 1 0 1 0 1 1 1 0 0 1
0 1 1 0 1 0 1 1 1 0 0 1
a)
1 0 0 1 ; b) 0 1 0 1 ; c) 1 1 1 1 .
9.20. Draw the directed graphs representing each of the relations from Ex. 9.19.
9.21. List the ordered pairs in the relation represented by the following directed graph:
9.22. Draw the directed graph that represents the following relation: {(a, a), (a, b), (b, c), (c, b), (c,
d), (d, a), (d, b)}.