Chapter 9
Chapter 9
Chapter 9
Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Chapter Summary
Relations and Their Properties
n-ary Relations and Their Applications (not currently
included in overheads)
Representing Relations
Closures of Relations (not currently included in
overheads)
Equivalence Relations
Partial Orderings
Relations and Their
Properties
Section 9.1
Section Summary
Relations and Functions
Properties of Relations
Reflexive Relations
Symmetric and Antisymmetric Relations
Transitive Relations
Combining Relations
Binary Relations
Definition: A binary relation R from a set A to a set B
is a subset R ⊆ A × B.
Example:
Let A = {0,1,2} and B = {a,b}
{(0, a), (0, b), (1,a) , (2, b)} is a relation from A to B.
We can represent relations from a set A to a set B
graphically or using a table:
Relations are more general than
functions. A function is a relation
where exactly one element of B is
related to each element of A.
Binary Relation on a Set
Definition: A binary relation R on a set A is a subset
of A × A or a relation from A to A.
Example:
Suppose that A = {a,b,c}. Then R = {(a,a),(a,b), (a,c)} is
a relation on A.
Let A = {1, 2, 3, 4}. The ordered pairs in the relation
R = {(a,b) | a divides b} are
(1,1), (1, 2), (1,3), (1, 4), (2, 2), (2, 4), (3, 3), and (4, 4).
Binary Relation on a Set (cont.)
Question: How many relations are there on a set A?
| A|2
× A. Therefore, there are 2 relations on a set A.
Binary Relations on a Set (cont.)
Example: Consider these relations on the set of integers:
R1 = {(a,b) | a ≤ b}, R4 = {(a,b) | a = b},
R2 = {(a,b) | a > b}, R5 = {(a,b) | a = b + 1},
R3 = {(a,b) | a = b or a = −b}, R6 = {(a,b) | a + b ≤ 3}.
Note that these relations are on an infinite set and each of these relations is an
infinite set.
(1,1), (1, 2), (2, 1), (1, −1), and (2, 2)?
Solution: Checking the conditions that define each relation, we see that 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 : (2,2) is in R1, R3, and R4.
Reflexive Relations
Definition: R is reflexive iff (a,a) ∊ R for every element a∊
A. Written symbolically, R is reflexive if and only if
∀x[x∊U ⟶ (x,x) ∊ R]
Example: The following relations on the integers are reflexive:
If A = ∅ then the empty relation is
R1 = {(a,b) | a ≤ b}, reflexive vacuously. That is the empty
relation on an empty set is reflexive!
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b}.
The following relations are not reflexive:
R2 = {(a,b) | a > b} (note that 3 ≯ 3),
R5 = {(a,b) | a = b + 1} (note that 3 ≠3 + 1),
R6 = {(a,b) | a + b ≤ 3} (note that 4 + 4 ≰ 3).
Symmetric Relations
Definition: R is symmetric iff (b,a) ∊ R whenever (a,b) ∊ R for all
a,b ∊ A. Written symbolically, R is symmetric if and only if
∀x∀y [(x,y) ∊R ⟶ (y,x) ∊ R]
Example: The following relations on the integers are symmetric:
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b},
R6 = {(a,b) | a + b ≤ 3}.
The following are not symmetric:
R1 = {(a,b) | a ≤ b} (note that 3 ≤ 4, but 4 ≰ 3),
R2 = {(a,b) | a > b} (note that 4 > 3, but 3 ≯ 4),
R5 = {(a,b) | a = b + 1} (note that 4 = 3 + 1, but 3 ≠4 + 1).
Antisymmetric Relations
Definition:A relation R on a set A such that for all a,b ∊ A if (a,b) ∊ R
and (b,a) ∊ R, then a = b is called antisymmetric. Written symbolically,
R is antisymmetric if and only if
∀x∀y [(x,y) ∊R ∧ (y,x) ∊ R ⟶ x = y]
Example: The following relations on the integers are antisymmetric:
R1 = {(a,b) | a ≤ b},
For any integer, if a ≤ b and
R2 = {(a,b) | a > b}, b ≤ a , then a = b.
R4 = {(a,b) | a = b},
R5 = {(a,b) | a = b + 1}.
The following relations are not antisymmetric:
R3 = {(a,b) | a = b or a = −b}
(note that both (1,−1) and (−1,1) belong to R3),
R6 = {(a,b) | a + b ≤ 3} (note that both (1,2) and (2,1) belong to R6).
Transitive Relations
Definition: A relation R on a set A is called transitive if whenever (a,b) ∊ R
and (b,c) ∊ R, then (a,c) ∊ R, for all a,b,c ∊ A. Written symbolically, R is
transitive if and only if
∀x∀y ∀z[(x,y) ∊R ∧ (y,z) ∊ R ⟶ (x,z) ∊ R ]
Example: The following relations on the integers are transitive:
R1 = {(a,b) | a ≤ b}, For every integer, a ≤ b
R = {(a,b) | a > b}, and b ≤ c, then b ≤ c.
2
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b}.
The following are not transitive:
R5 = {(a,b) | a = b + 1} (note that both (3,2) and (2,1) belong to R5, but not
(3,1)),
R6 = {(a,b) | a + b ≤ 3} (note that both (2,1) and (1,2) belong to R6, but not
(2,2)).
Combining Relations
Given two relations R1 and R2, we can combine them
using basic set operations to form new relations such
as R1 ∪ R2, R1 ∩ R2, R1 − R2, and R2 − R1.
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 using
basic set operations to form new relations:
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)}
Composition
Definition: Suppose
R1 is a relation from a set A to a set B.
R2 is a relation from B to a set C.
R2∘ R1 = {(b,z),(b,x)}
Powers of a Relation
Definition: Let R be a binary relation on A. Then the
powers Rn of the relation R can be defined inductively by:
Basis Step: R1 = R
Inductive Step: Rn+1 = Rn ∘ R
(see the slides for Section 9.3 for further insights)
The powers of a transitive relation are subsets of the
relation. This is established by the following theorem:
Theorem 1: The relation R on a set A is transitive iff
Rn ⊆ R for n = 1,2,3 ….
(see the text for a proof via mathematical induction)
Representing Relations
Section 9.3
Section Summary
Representing Relations using Matrices
Representing Relations using Digraphs
Representing Relations Using Matrices
A relation between finite sets can be represented using a zero-one
matrix.
Suppose R is a relation from A = {a1, a2, …, am} to B = {b1,
b2, …, bn}.
The elements of the two sets can be listed in any particular arbitrary order.
When A = B, we use the same ordering.
The relation R is represented by the matrix MR =
[mij], where
R = {(a1, b2), (a2, b1),(a2, b3), (a2, b4),(a3, b1), {(a3, b3), (a3, b5)}.
Matrices of Relations on Sets
If R is a reflexive relation, all the elements on the main
diagonal of MR are equal to 1.
a b
c d
a
b
c d
• Reflexive? No, there are no loops
• Symmetric? No, there is an edge from a to b, but not from b to a
• Antisymmetric? No, there is an edge from d to b and b to d
• Transitive? No, there are edges from a to c and from c to b,
but there is no edge from a to d
Determining which Properties a Relation
has from its Digraph – Example 3
a
b
c d
Reflexive? No, there are no loops
Symmetric? No, for example, there is no edge from c to a
Antisymmetric? Yes, whenever there is an edge from one
vertex to another, there is not one going back
Transitive? No, there is no edge from a to b
Determining which Properties a Relation
has from its Digraph – Example 4
b
a
c d
• Reflexive? No, there are no loops
• Symmetric? No, for example, there is no edge from d to a
• Antisymmetric? Yes, whenever there is an edge from one vertex
to another, there is not one going back
• Transitive? Yes (trivially), there are no two edges where the first
edge ends at the vertex where the second edge begins
Example of the Powers of a Relation
a b a b
d c d c
R R2
a b b
a
d c d c
R4 R 3
If b ∈ [a]R, then b is called a representative of this equivalence class. Any element of a class can
be used as a representative of the class.
The equivalence classes of the relation congruence modulo m are called the congruence classes
modulo m. The congruence class of an integer a modulo m is denoted by [a]m, so [a]m = {…,
a−2m, a−m, a, a+m, a+2m, … }. For example,
A Partition of a Set
An Equivalence Relation Partitions a Set
Let R be an equivalence relation on a set A. The union of
all the equivalence classes of R is all of A, since an
element a of A is in its own equivalence class [a]R. In
other words,
These properties all follow from the order axioms for the integers.
(See Appendix 1).
Partial Orderings (continued)
Example 2: Show that the divisibility relation (∣) is a
partial ordering on the set of integers.
Reflexivity: a ∣ a for all integers a. (see Example 9 in
Section 9.1)
Antisymmetry: If a and b are positive integers with a | b
and b | a, then a = b. (see Example 12 in Section 9.1)
Transitivity: Suppose that a divides b and b divides c.
Then there are positive integers k and l such that b = ak
and c = bl. Hence, c = a(kl), so a divides c. Therefore, the
relation is transitive.
(Z+, ∣) is a poset.
Partial Orderings (continued)
Example 3: Show that the inclusion relation (⊆) is a
partial ordering on the power set of a set S.
Reflexivity: A ⊆ A whenever A is a subset of S.
Antisymmetry: If A and B are positive integers with
A ⊆ B and B ⊆ A, then A = B.
Transitivity: If A ⊆ B and B ⊆ C, then A ⊆ C.