100% found this document useful (1 vote)
55 views46 pages

Discrete Mathematics 5

This document summarizes key concepts about relations from Chapter 7 of the textbook Discrete Mathematics and Its Applications. It defines what a binary relation is and provides examples of relations between sets of cities and states. It then discusses properties of relations such as reflexivity, symmetry, antisymmetry, and transitivity. The document also explains how to represent relations using ordered pairs, tables, zero-one matrices, and directed graphs.

Uploaded by

Mominul Haque
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
55 views46 pages

Discrete Mathematics 5

This document summarizes key concepts about relations from Chapter 7 of the textbook Discrete Mathematics and Its Applications. It defines what a binary relation is and provides examples of relations between sets of cities and states. It then discusses properties of relations such as reflexivity, symmetry, antisymmetry, and transitivity. The document also explains how to represent relations using ordered pairs, tables, zero-one matrices, and directed graphs.

Uploaded by

Mominul Haque
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Discrete Mathematics

and Its Applications

Chapter 7
Relations

歐亞書局
2

Relations (7.1) (cont.)

• Relations & their properties

– Definition 1

Let A and B be sets. A binary relation from A to


B is a subset of A * B.

In other words, a binary relation from A to B is a


set R of ordered pairs where the first element of
each ordered pair comes from A and the second
element comes from B.
3

Relations (7.1) (cont.)

– 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

Relations (7.1) (cont.)

– 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

Relations (7.1) (cont.)

• Functions as relations
– The graph of a function f is the set of ordered pairs
(a, b) such that b = f(a)

– The graph of f is a subset of A * B ⇒ it is a


relation from A to B

– Conversely, if R is a relation from A to B such that


every element in A is the first element of exactly
one ordered pair of R, then a function can be
defined with R as its graph
6

Relations (7.1) (cont.)


• Relations on a set
– Definition 2
A relation on the set A is a relation from A to A.

– Example: A = set {1, 2, 3, 4}. Which ordered pairs are in


the relation R = {(a, b) | a divides b}

Solution: Since (a, b) is in R if and only if a and b are


positive integers not exceeding 4 such that a divides b

R = {(1,1), (1,2), (1.3), (1.4), (2,2), (2,4), (3,3), (4,4)}


7

Relations (7.1) (cont.)

• Properties of Relations

– Definition 3

A relation R on a set A is called reflexive if


(a, a) ∈ R for every element a ∈ A.
8

Relations (7.1) (cont.)

– Example (a): Consider the following relations on


{1, 2, 3, 4}

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)}

Which of these relations are reflexive?


9

Relations (7.1) (cont.)

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

Relations (7.1) (cont.)

– Definition 4:

A relation R on a set A is called symmetric if (b,


a) ∈ R whenever (a, b) ∈ R, for all a,
b ∈ A.
A relation R on a set A such that (a, b) ∈ R and
(b, a) ∈ R only if a = b, for all a, b ∈ A, is called
antisymmetric.
11

Relations (7.1) (cont.)


– Example: Which of the relations from example (a) are symmetric and
which are antisymmetric?
Solution:
❖ R2 & R3: symmetric ⇐ each case (b, a) belongs to the relation
whenever (a, b) does.
For R2: only thing to check that both (1,2) & (2,1) belong to the
relation
For R3: it is necessary to check that both (1,2) & (2,1) belong to the
relation.
None of the other relations is symmetric: find a pair (a, b) so that it is
in the relation but (b, a) is not.
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), (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)}
12

Relations (7.1) (cont.)


Solution (cont.):

❖ R4, R5 and R6: antisymmetric ⇐for each of these relations


there is no pair of elements a and b with
a ≠ b such that both (a, b) and (b, a) belong to the
relation.
None of the other relations is antisymmetric.: find a pair
(a, b) with a ≠ b so that (a, b) and (b, a) are both in the
relation.
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)}
13

Relations (7.1) (cont.)

– Definition 5:

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 ∈ R.
14

Relations (7.1) (cont.)


– Example: Which of the relations in example (a) are transitive?
❖ R4 , R5 & R6 : transitive ⇐ verify that if (a, b) and (b, c) belong to this
relation then (a, c) belongs also to the relation
R4 transitive since (3,2) and (2,1), (4,2) and (2,1), (4,3) and (3,1), and (4,3)
and (3,2) are the only such sets of pairs, and (3,1) , (4,1) and (4,2) belong
to R4.
Same reasoning for R5 and R6.
❖ R1 : not transitive ⇐ (3,4) and (4,1) belong to R1, but (3,1) does not.
❖ R2 : not transitive ⇐ (2,1) and (1,2) belong to R2, but (2,2) does not.
❖ R3 : not transitive ⇐ (4,1) and (1,2) belong to R3, but (4,2) does not.

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)}
15

Relations (7.1) (cont.)

• Combining relations
– 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 to obtain:

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)}
16

Relations (7.1) (cont.)


– Definition 6:

Let R be a relation from a set A to a set B and S a


relation from B to a set C.
The composite of R and S is the relation
consisting of ordered pairs (a, c), where a ∈ A, c
∈ C, and for which there exists an element b ∈ B
such that (a, b) ∈ R and (b, c) ∈ S. We denote
the composite of R and S by S ° R.
17

Relations (7.1) (cont.)


– Example: What is the composite of the relations R and S
where R is the relation from {1,2,3} to {1,2,3,4} with R =
{(1,1), (1,4), (2,3), (3,1), (3,4)} and S is the relation from
{1,2,3,4} to {0,1,2} with S = {(1,0), (2,0), (3,1), (3,2),
(4,1)}?

Solution: S ° R is constructed using all ordered pairs in R


and ordered pairs in S, where the second element of the
ordered in R agrees with the first element of the
ordered pair in S.
For example, the ordered pairs (2,3) in R and (3,1) in S
produce the ordered pair (2,1) in S ° R. Computing all the
ordered pairs in the composite, we find
S ° R = ((1,0), (1,1), (2,1), (2,2), (3,0), (3,1)}
7.3 Representing Relations

• To represent binary relations


– Ordered pairs
– Tables
– Zero-one matrices
– Directed graphs
Representing Relations Using Matrices

• Suppose that R is a relation from


A={a1,a2,…,am} to B={b1,b2,…,bn}. R can be
represented by the matrix MR=[mij], where
mij=1 if (ai,bj)∈R, or 0 if (ai,bj)∉R.
– Ex.1-6
FIGURE 1 (7.3)

FIGURE 1 The Zero-One Matrix for a Reflexive Relation.

歐亞書局 P. 538
FIGURE 2 (7.3)

FIGURE 2 The Zero-One Matrices for Symmetric and


Antisymmetric Relations.

歐亞書局 P. 539
Representing Relations Using Digraphs

• Definition 1: A directed graph (digraph)


consists of a set V of vertices (or nodes) and a
set E of ordered pairs of elements of V called
edges (or arcs). The vertex a is called the
initial vertex of the edge (a,b), and the vertex b
is called the terminal vertex of this edge.
– Ex.7-10
FIGURE 3 (7.3)

FIGURE 3 The Directed Graph.

歐亞書局 P. 541
FIGURE 4 (7.3)

FIGURE 4 The Directed Graph of the Relations R.

歐亞書局 P. 542
FIGURE 5 (7.3)

FIGURE 5 The Directed Graph of the Relations R.

歐亞書局 P. 542
FIGURE 6 (7.3)

FIGURE 6 The Directed Graph of the Relations R and S.

歐亞書局 P. 542
8.5 Equivalence Relations

• Definition 1: A relation on a set A is called an


equivalence relation if it is reflexive, symmetric, and
transitive.
• Definition 2: Two elements a and b are related by an
equivalence relation are called equivalent.
– The notation a~b: to denote that a and b are equivalent
elements with respect to a particular equivalence relation
– Ex. 1-5: equivalence relations
– Ex. 6-7: not equivalence relations
Equivalence Classes

• Definition 3: Let R be an equivalence relation


on a set A. The set of all elements that are
related to an element a of A is called the
equivalence class of a.
– Denoted by [a]R or [a]
– [a]R = {s|(a,s)∈R}
– If b∈[a]R, then b is called a representative of the
equivalence class
– Ex. 8-11
8.6 Partial Orderings

• Definition 1: A relation R on a set S is called a partial


ordering or partial order if it is reflexive,
antisymmetric, and transitive.
– A set S together with its partial ordering R is called a
partially ordered set, or poset, (S, R).
– Proof.
– Ex.1-3: ≥, |, ⊆
– Ex.4: older than
– Notation:
• : a ≤ b, but a≠b
• Definition 2: The elements a and b of a poset
(S, ) are called comparable if either
a b or b a.
– If neither a b nor b a, a and b are
incomparable. (“partial”)
– Ex. 5
– When every two elements in the set are
comparable, the relation is called a total ordering
• Definition 3: If (S, ) is a poset and every two
elements of S are comparable, S is called a totally
ordered or linearly ordered set (or a chain), and is
called a total order or a linear order.
– Ex.6: (Z, ≤)
– Ex.7: (Z+, |)
• Definition 4: (S, ) is a well-ordered set if it is a
poset such that is a total ordering and every
nonempty subset of S has a least element.
– Ex.8
• Theorem 1: (The Principle of Well-Ordered
Induction) Suppose that S is a well-ordered set.
Then P(x) is true for all x∈S, if
(inductive step): For every y∈S, if P(x) is true
for all x∈S with x y, then P(y) is true.
– Proof.
Lexicographic Order

• (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

• Hasse Diagrams: some edges do not have to be


shown
– Reflexive: loops can be removed
– Transitive: if (a,b) and (b,c), then (a,c) can be
removed
– Remove all the arrows
– Ex. 12: (Fig. 3)
– Ex. 13: (Fig. 4)
FIGURE 2 (8.6)

FIGURE 2 Constructing the Hasse Diagram for ({1,2,3,4},≦).


歐亞書局 P. 571
FIGURE 3 (8.6)

FIGURE 3 Constructing the Hasse Diagram of ({1,2,3,4,6,8,12},|).

歐亞書局 P. 572
FIGURE 4 (8.6)

FIGURE 4 The Hasse Diagram of (P({a,b,c}), ).


歐亞書局 P. 573
Maximal and Minimal Elements

• a is maximal in the poset (S, ) if there is no


b∈S such that a b.
• a is minimal in the poset (S, ) if there is no
b∈S such that b a.
– Ex. 14: (Fig. 5)
– Ex. 15: (Fig. 6)
– Ex. 16-17
FIGURE 5 (8.6)

FIGURE 5 The Hasse Diagram of a Poset.

歐亞書局 P. 573
FIGURE 6 (8.6)

FIGURE 6 Hasse Diagrams of Four Posets.

歐亞書局 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)

FIGURE 7 The Hasse Diagram of a Poset.


歐亞書局 P. 574
Lattices

• A partially ordered set in which every pair of


elements has both a least upper bound and a
greatest lower bound is called a lattice
– Ex. 21: (Fig. 8)
– Ex. 22-25
FIGURE 8 (8.6)

FIGURE 8 Hasse Diagrams of Three Posets.


歐亞書局 P. 575
Thank You

You might also like