6 Relation
6 Relation
6 Relation
Chapter Summary
Relations and Their Properties
Representing Relations
Equivalence Relations
Partial Orderings
Hasse Diagram
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:
Example:
Suppose that A = {a,b,c}. Then R = {(a,a),(a,b), (a,c)} is a
relation on A.
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,x) ∊ R]
Solution:
a
b
c d
Reflexive? No, there are no loops
Symmetric? No, for example, there is no edge from c to a
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
Determining which Properties a Relation
has from its Digraph – Example 3
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, but b≠d
• Transitive? No, there are edges from a to b and from b to d, but there is
no edge from a to d
Determining which Properties a Relation
has from its Digraph – Example 4
a b
c d
Symmetry: Suppose that aRb. Since l(a) = l(b), l(b) = l(a) also holds
and bRa.
Transitivity: Suppose that aRb and bRc. Since l(a) = l(b),and l(b) = l(c),
l(a) = l(c) also holds and aRc.
Congruence Modulo m
Example 2: Let m be an integer with m > 1. Show that the relation
R = {(a,b) | a ≡ b (mod m)} is an equivalence relation on the set of
integers.
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,
Proof: We show that (i) implies (ii). Assume that aRb. Now
suppose that c ∈ [a]. Then aRc. Because aRb and R is
symmetric, bRa. Because R is transitive and bRa and aRc, it
follows that bRc. Hence, c ∈ [b]. Therefore, [a]⊆ [b]. A similar
argument (omitted here) shows that [b]⊆ [a]. Since [a]⊆ [b]
and [b]⊆ [a], we have shown that [a] = [b].
Partition of a Set
Definition: A partition of a set S is a collection of
disjoint nonempty subsets of S that have S as their
union. In other words, the collection of subsets Ai,
where i ∈ I (where I is an index set), forms a partition
of S if and only if
Ai ≠ ∅ for i ∈ I,
Ai ∩ Aj=∅ when i ≠ j,
and
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,
Solution:
Reflexivity: a ≥ a for every integer a.
Antisymmetry: If a ≥ b and b ≥ a, then a = b.
Transitivity: If a ≥ b and b ≥ c, then a ≥ c.
52
Example
In the poset (Z+,≤), are the integers 3 and 9 comparable?
Yes, as 3 ≤ 9