Discrete Mathematics 5
Discrete Mathematics 5
Chapter 7
Relations
歐亞書局
2
– Definition 1
– Notation:
aRb ⇔ (a, b) ∈ R
aRb ⇔ (a, b) ∉ R
0
R a b
a
1 0 X X
b
1 X
2 2 X
4
– Example:
A = set of all cities
B = set of the 50 states in the USA
Define the relation R by specifying that (a, b)
belongs to R if city a is in state b.
5
• Functions as relations
– The graph of a function f is the set of ordered pairs
(a, b) such that b = f(a)
• Properties of Relations
– Definition 3
Solution:
R3 and R5: reflexive ⇐ both contain all pairs of the
form (a, a): (1,1), (2,2), (3,3) & (4,4).
R1, R2, R4 and R6: not reflexive ⇐ not contain all of
these ordered pairs. (3,3) is not in any of these
relations.
R1 = {(1,1), (1,2), (2,1), (2,2), (3,4), (4,1), (4,4)}
R2 = {(1,1), (1,2), (2,1)}
R3 = {(1,1), (1,2), (1,4), (2,1), (2,2), (3,3), (3,4), (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)}
R6 = {(3,4)}
10
– Definition 4:
– Definition 5:
• Combining relations
– Example:
歐亞書局 P. 538
FIGURE 2 (7.3)
歐亞書局 P. 539
Representing Relations Using Digraphs
歐亞書局 P. 541
FIGURE 4 (7.3)
歐亞書局 P. 542
FIGURE 5 (7.3)
歐亞書局 P. 542
FIGURE 6 (7.3)
歐亞書局 P. 542
8.5 Equivalence Relations
• (A1, 1
), (A2, )
2
– (a1, a2) (b1, b2)
• Either if a1 1 b1
• Or if a1=b1 and a2 2
b2
– Ex.9-10
– n-tuples (Fig. 1)
– Ex.11
FIGURE 1 (8.6)
FIGURE 1
The Ordered
Pairs Less Than
(3,4) in
Lexicographic
Order.
歐亞書局 P. 570
Hasse Diagrams
歐亞書局 P. 572
FIGURE 4 (8.6)
歐亞書局 P. 573
FIGURE 6 (8.6)
歐亞書局 P. 573
• In a subset A of a poset (S, ), if u is an
element of S such that a u for all a∈A, then
u is an upper bound of A.
• In a subset A of a poset (S, ), if l is an
element of S such that l a for all a∈A, then l
is an lower bound of A.
– Ex. 18: (Fig. 7)
– Ex. 19: (Fig. 7)
– Ex. 20
FIGURE 7 (8.6)