Pertemuan 10 - 1
Pertemuan 10 - 1
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
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?
(1,1), (1, 2), (2, 1), (1, −1), and (2, 2)?
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 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)
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 R3
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).