Chapter 9
Chapter 9
Chapter 9
Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-
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
to a set B is a subset R ⊆ A × B.
Definition: A binary relation R from a set A
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
subset of A × A or a relation from A to A.
Definition: A binary relation R on a set A is a
Example:
Suppose that A = {a,b,c}. Then R = {(a,a),
(1,1), (1, 2), (2, 1), (1, −1), and (2, 2)?
that the pair (1,1) is in R1, R3, R4 , and R6: (1,2) is in R1 and R6: (2,1) is
Solution: Checking the conditions that define each relation, we see
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
If A = ∅ then the empty relation is
R1 = {(a,b) | a ≤ b},
reflexive:
reflexive vacuously. That is the
R3 = {(a,b) | a = b or a = −b},
empty relation on an empty set is
R4 = {(a,b) | a = b}.
reflexive!
R3 = {(a,b) | a = b or a = −b},
symmetric:
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
R1 = {(a,b) | a ≤ b},
Example: The following relations on the integers are transitive:
For every integer, a ≤ b
R2 = {(a,b) | a > b}, and b ≤ c, then b ≤ c.
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 (4,3) belong to R5,
but not (3,3)),
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
1 ∪ R2 ={(1,1),(1,2),(1,3),(1,4),(2,2),
R2 = {(1,1),(1,2),(1,3),(1,4)} can
beRcombined
R1 ∩ R2 relations: R1 − R2 ={(2,2),
using basic set operations to
(3,3)}
form new
R2 − R1 ={(1,2),(1,3),(1,4)}
={(1,1)} (3,3)}
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.
R1∘ R2 = {(b,D),
(b,B)}
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
R = {(a1, b2), (a2, b1),(a2, b3), (a2, b4),(a3, b1), {(a3, b3), (a3,
b5)}.
Matrices of Relations on Sets
the main diagonal of MR are equal to 1.
If R is a reflexive relation, all the elements on
(1, 3), (1, 4), (2, 1), (2, 2), (2, 3), (3, 1), (3,
are
so is (x,z).
Determining which Properties a Relation
has from its Digraph – Example 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
Example of the Powers of a Relation
a b a b
R2
d c d c
R
a b b
a
3
R4
d c d c
R
The pair (x,y) is in Rn if there is a path of length n from x to y in R
(following the direction of the arrows).
Equivalence Relations
Section 9.5
Section Summary
Equivalence Relations
Equivalence Classes
Equivalence Classes and Partitions
Equivalence Relations
Definition 1: A relation on a set A is called
an equivalence relation if it is reflexive,
symmetric, and transitive.
denoted by [a]m, so [a]m = {…, a−2m, a−m, a+2m, a+2m, … }. For example,
congruence classes modulo m. The congruence class of an integer a modulo m is
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,
For the second part, assume that {Ai | i ∈ I} is a partition of S. Let R be the
Proof: We have already shown the first part of the theorem.
relation on S consisting of the pairs (x, y) where x and y belong to the same
subset Ai in the partition. We must show that R satisfies the properties of an
equivalence relation.
Reflexivity: For every a ∈ S, (a,a) ∈ R, because a is in the same subset as itself.
Symmetry: If (a,b) ∈ R, then b and a are in the same subset of the partition, so
(b,a) ∈ R.
Transitivity: If (a,b) ∈ R and (b,c) ∈ R, then a and b are in the same subset of the
two subsets of the partition must be identical. Therefore, (a,c) ∈ R since a and c
partition, as are b and c. Since the subsets are disjoint and b belongs to both, the
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.
(Z+, ∣) is a poset.
Therefore, the relation is transitive.
Partial Orderings (continued)
Example 3: Show that the inclusion relation
(⊆) is a partial ordering on the power set of a
A ⊆ B and B ⊆ A, then A = B.
Antisymmetry: If A and B are positive integers