2. Product Sets
Definition: An ordered pair ๐๐, ๐๐ is a listing of the
objects/items ๐๐ and ๐๐ in a prescribed order: ๐๐ is the first
and ๐๐ is the second. (a sequence of length 2)
Definition: The ordered pairs ๐๐1, ๐๐1 and ๐๐2, ๐๐2 are
equal iff ๐๐1 = ๐๐2 and ๐๐1 = ๐๐2.
Definition: If ๐ด๐ด and ๐ต๐ต are two nonempty sets, we define
the product set or Cartesian product ๐ด๐ด ร ๐ต๐ต as the set of
all ordered pairs ๐๐, ๐๐ with ๐๐ โ ๐ด๐ด and ๐๐ โ ๐ต๐ต:
๐ด๐ด ร ๐ต๐ต = ๐๐, ๐๐ ๐๐ โ ๐ด๐ด and ๐๐ โ ๐ต๐ต}
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 2
3. Product Sets
Example: Let ๐ด๐ด = 1,2,3 and ๐ต๐ต = ๐๐, ๐ ๐ , then
๐ด๐ด ร ๐ต๐ต =
๐ต๐ต ร ๐ด๐ด =
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 3
4. Product Sets
Theorem: For any two finite sets ๐ด๐ด and ๐ต๐ต,
๐ด๐ด ร ๐ต๐ต = ๐ด๐ด โ ๐ต๐ต .
Proof: Use multiplication principle!
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 4
5. Definitions:
๏ง Let ๐ด๐ด and ๐ต๐ต be nonempty sets. A relation ๐ ๐ from ๐ด๐ด
to ๐ต๐ต is a subset of ๐ด๐ด ร ๐ต๐ต.
๏ง If ๐ ๐ โ ๐ด๐ด ร ๐ต๐ต and ๐๐, ๐๐ โ ๐ ๐ , we say that ๐๐ is related
to ๐๐ by ๐ ๐ , and we write ๐๐ ๐ ๐ ๐๐.
๏ง If ๐๐ is not related to ๐๐ by ๐ ๐ , we write ๐๐ ๐ ๐ ๐๐.
๏ง If ๐ ๐ โ ๐ด๐ด ร ๐ด๐ด, we say ๐ ๐ is a relation on ๐ด๐ด.
Relations & Digraphs
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 5
6. Example 1: Let ๐ด๐ด = 1,2,3 and ๐ต๐ต = ๐๐, ๐ ๐ . Then
๐ ๐ = 1, ๐๐ , 2, ๐ ๐ , 3, ๐๐ โ ๐ด๐ด ร ๐ต๐ต
is a relation from ๐ด๐ด to ๐ต๐ต.
Example 2: Let ๐ด๐ด and ๐ต๐ต are sets of positive integer
numbers. We define the relation ๐ ๐ โ ๐ด๐ด ร ๐ต๐ต by
๐๐ ๐ ๐ ๐๐ โ ๐๐ = ๐๐
Relations & Digraphs
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 6
7. Example 3: Let ๐ด๐ด = 1,2,3,4,5 . The relation ๐ ๐ โ ๐ด๐ด ร ๐ด๐ด is
defined by
๐๐ ๐ ๐ ๐๐ โ ๐๐ < ๐๐
Then ๐ ๐ =
Example 4: Let ๐ด๐ด = 1,2,3,4,5,6,7,8,9,10 . The relation
๐ ๐ โ ๐ด๐ด ร ๐ด๐ด is defined by
๐๐ ๐ ๐ ๐๐ โ ๐๐|๐๐
Then ๐ ๐ =
Relations & Digraphs
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 7
8. Definition: Let ๐ ๐ โ ๐ด๐ด ร ๐ต๐ต be a relation from ๐ด๐ด to ๐ต๐ต.
๏ง The domain of ๐ ๐ , denoted by Dom ๐ ๐ , is the set of
elements in ๐ด๐ด that are related to some element in
๐ต๐ต.
๏ง The range of ๐ ๐ , denoted by Ran ๐ ๐ , is the set of
elements in ๐ต๐ต that are second elements of pairs in
๐ ๐ .
Relations & Digraphs
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 8
9. Relations & Digraphs
Example 5: Let ๐ด๐ด = 1,2,3 and ๐ต๐ต = ๐๐, ๐ ๐ .
๐ ๐ = 1, ๐๐ , 2, ๐ ๐ , 3, ๐๐
Dom R =
Ran R =
Example 6: Let ๐ด๐ด = 1,2,3,4,5 . The relation ๐ ๐ โ ๐ด๐ด ร ๐ด๐ด is
defined by ๐๐ ๐ ๐ ๐๐ โ ๐๐ < ๐๐
Dom R =
Ran R =
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 9
10. The Matrix of a Relation
Definition: Let ๐ด๐ด = ๐๐1, ๐๐2, โฆ , ๐๐ ๐๐ , ๐ต๐ต = ๐๐1, ๐๐2, โฆ , ๐๐๐๐
and ๐ ๐ โ ๐ด๐ด ร ๐ต๐ต be a relation. We represent ๐ ๐ by the ๐๐ ร
๐๐ matrix ๐๐๐ ๐ = [๐๐๐๐๐๐], which is defined by
๐๐๐๐๐๐ = ๏ฟฝ
1, ๐๐๐๐, ๐๐๐๐ โ ๐ ๐
0, ๐๐๐๐, ๐๐๐๐ โ ๐ ๐
The matrix ๐๐๐ ๐ is called the matrix of ๐ ๐ .
Example: Let ๐ด๐ด = 1,2,3 and ๐ต๐ต = ๐๐, ๐ ๐ .
๐ ๐ = 1, ๐๐ , 2, ๐ ๐ , 3, ๐๐ ๐๐๐ ๐ =
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 10
11. The Digraph of a Relation
Definition: If ๐ด๐ด is finite and ๐ ๐ โ ๐ด๐ด ร ๐ด๐ด is a relation. We
represent ๐ ๐ pictorially as follows:
๏ง Draw a small circle, called a vertex/node, for each
element of ๐ด๐ด and label the circle with the
corresponding element of ๐ด๐ด.
๏ง Draw an arrow, called an edge, from vertex ๐๐๐๐ to
vertex ๐๐๐๐ iff ๐๐๐๐ ๐ ๐ ๐๐๐๐.
The resulting pictorial representation of ๐ ๐ is called a
directed graph or digraph of ๐ ๐ .
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 11
12. The Digraph of a Relation
Example: Let ๐ด๐ด = 1, 2, 3, 4 and
๐ ๐ = 1,1 , 1,2 , 2,1 , 2,2 , 2,3 , 2,4 , 3,4 , 4,1
The digraph of ๐ ๐ :
Example: Let ๐ด๐ด = 1, 2, 3, 4 and
Find the relation ๐ ๐ :
ยฉ S. Turaev, CSC 1700 Discrete Mathematics
1
2
3
4
12
13. The Digraph of a Relation
Definition: If ๐ ๐ is a relation on a set ๐ด๐ด and ๐๐ โ ๐ด๐ด, then
๏ง the in-degree of ๐๐ is the number of ๐๐ โ ๐ด๐ด such that
๐๐, ๐๐ โ ๐ ๐ ;
๏ง the out-degree of ๐๐ is the number of ๐๐ โ ๐ด๐ด such
that ๐๐, ๐๐ โ ๐ ๐ .
Example: Consider the digraph:
List in-degrees and out-degrees of all vertices.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics
1
2
3
4
13
14. The Digraph of a Relation
Example: Let ๐ด๐ด = ๐๐, ๐๐, ๐๐, ๐๐ and let ๐ ๐ be the relation on
๐ด๐ด that has the matrix
๐๐๐ ๐ =
1 0
0 1
0 0
0 0
1 1
0 1
1 0
0 1
Construct the digraph of ๐ ๐ and list in-degrees and out-
degrees of all vertices.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 14
15. The Digraph of a Relation
Example: Let ๐ด๐ด = 1,4,5 and let ๐ ๐ be given the digraph
Find ๐๐๐ ๐ and ๐ ๐ .
ยฉ S. Turaev, CSC 1700 Discrete Mathematics
1 4
5
15
16. Paths in Relations & Digraphs
Definition: Suppose that ๐ ๐ is a relation on a set ๐ด๐ด.
A path of length ๐๐ in ๐ ๐ from ๐๐ to ๐๐ is a finite sequence
๐๐ โถ ๐๐, ๐ฅ๐ฅ1, ๐ฅ๐ฅ2, โฆ , ๐ฅ๐ฅ๐๐โ1, ๐๐
beginning with ๐๐ and ending with ๐๐, such that
๐๐ ๐ ๐ ๐ฅ๐ฅ1, ๐ฅ๐ฅ1 ๐ ๐ ๐ฅ๐ฅ2, โฆ , ๐ฅ๐ฅ๐๐โ1 ๐ ๐ ๐๐.
Definition: A path that begins and ends at the same
vertex is called a cycle:
๐๐ โถ ๐๐, ๐ฅ๐ฅ1, ๐ฅ๐ฅ2, โฆ , ๐ฅ๐ฅ๐๐โ1, ๐๐
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 16
17. Paths in Relations & Digraphs
Example: Give the examples for paths of length 1,2,3,4
and 5.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics
1 2
43
5
17
18. Paths in Relations & Digraphs
Definition: If ๐๐ is a fixed number, we define a relation ๐ ๐ ๐๐
as follows: ๐ฅ๐ฅ ๐ ๐ ๐๐
๐ฆ๐ฆ means that there is a path of length ๐๐
from ๐ฅ๐ฅ to ๐ฆ๐ฆ.
Definition: We define a relation ๐ ๐ โ
(connectivity relation
for ๐ ๐ ) on ๐ด๐ด by letting ๐ฅ๐ฅ ๐ ๐ โ
๐ฆ๐ฆ mean that there is some
path from ๐ฅ๐ฅ to ๐ฆ๐ฆ.
Example: Let ๐ด๐ด = ๐๐, ๐๐, ๐๐, ๐๐, ๐๐ and
๐ ๐ = ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ .
Compute (a) ๐ ๐ 2
; (b) ๐ ๐ 3
; (c) ๐ ๐ โ
.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 18
19. Paths in Relations & Digraphs
Let ๐ ๐ be a relation on a finite set ๐ด๐ด = ๐๐1, ๐๐2, โฆ , ๐๐๐๐ , and
let ๐๐๐ ๐ be the ๐๐ ร ๐๐ matrix representing ๐ ๐ .
Theorem 1: If ๐ ๐ is a relation on ๐ด๐ด = ๐๐1, ๐๐2, โฆ , ๐๐๐๐ , then
๐๐๐ ๐ 2 = ๐๐๐ ๐ โ ๐๐๐ ๐ .
Example: Let ๐ด๐ด = ๐๐, ๐๐, ๐๐, ๐๐, ๐๐ and
๐ ๐ = ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ , ๐๐, ๐๐ .
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 19
21. Reflexive & Irreflexive Relations
Definition:
๏ง A relation ๐ ๐ on a set ๐ด๐ด is reflexive if ๐๐, ๐๐ โ ๐ ๐ for
all ๐๐ โ ๐ด๐ด, i.e., if ๐๐ ๐ ๐ ๐๐ for all ๐๐ โ ๐ด๐ด.
๏ง A relation ๐ ๐ on a set ๐ด๐ด is irreflexive if ๐๐ ๐ ๐ ๐๐ for all
๐๐ โ ๐ด๐ด.
Example:
๏ง ฮ = ๐๐, ๐๐ | ๐๐ โ ๐ด๐ด , the relation of equality on the
set ๐ด๐ด.
๏ง ๐ ๐ = ๐๐, ๐๐ โ ๐ด๐ด ร ๐ด๐ด| ๐๐ โ ๐๐ , the relation of
inequality on the set ๐ด๐ด.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 21
22. Reflexive & Irreflexive Relations
Exercise: Let ๐ด๐ด = 1, 2, 3 , and let ๐ ๐ = 1,1 , 1,2 .
Is ๐ ๐ reflexive or irreflexive?
Exercise: How is a reflexive or irreflexive relation
identified by its matrix?
Exercise: How is a reflexive or irreflexive relation
characterized by the digraph?
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 22
23. (A-, Anti-) Symmetric Relations
Definition:
๏ง A relation ๐ ๐ on a set ๐ด๐ด is symmetric if whenever
๐๐ ๐ ๐ ๐๐, then ๐๐ ๐ ๐ ๐๐.
๏ง A relation ๐ ๐ on a set ๐ด๐ด is asymmetric if whenever
๐๐ ๐ ๐ ๐๐, then ๐๐ ๐ ๐ ๐๐.
๏ง A relation ๐ ๐ on a set ๐ด๐ด is antisymmetric if whenever
๐๐ ๐ ๐ ๐๐ and ๐๐ ๐ ๐ ๐๐, then ๐๐ = ๐๐.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 23
24. (A-, Anti-) Symmetric Relations
Example: Let ๐ด๐ด = 1, 2, 3, 4, 5, 6 and let
๐ ๐ = ๐๐, ๐๐ โ ๐ด๐ด ร ๐ด๐ด | ๐๐ < ๐๐
Is ๐ ๐ symmetric, asymmetric or antisymmetric?
๏ง Symmetry:
๏ง Asymmetry:
๏ง Antisymmetry:
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 24
25. (A-, Anti-) Symmetric Relations
Example: Let ๐ด๐ด = 1, 2, 3, 4 and let
๐ ๐ = 1,2 , 2,2 , 3,4 , 4,1
Is ๐ ๐ symmetric, asymmetric or antisymmetric?
Example: Let ๐ด๐ด = โค+
and let
๐ ๐ = ๐๐, ๐๐ โ ๐ด๐ด ร ๐ด๐ด | ๐๐ divides ๐๐
Is ๐ ๐ symmetric, asymmetric or antisymmetric?
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 25
26. (A-, Anti-) Symmetric Relations
Exercise: How is a symmetric, asymmetric or
antisymmetric relation identified by its matrix?
Exercise: How is a symmetric, asymmetric or
antisymmetric relation characterized by the digraph?
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 26
27. Transitive Relations
Definition: A relation ๐ ๐ on a set ๐ด๐ด is transitive if
whenever ๐๐ ๐ ๐ ๐๐ and ๐๐ ๐ ๐ ๐๐ then ๐๐ ๐ ๐ ๐๐.
Example: Let ๐ด๐ด = 1, 2, 3, 4 and let
๐ ๐ = 1,2 , 1,3 , 4,2
Is ๐ ๐ transitive?
Example: Let ๐ด๐ด = โค+
and let
๐ ๐ = ๐๐, ๐๐ โ ๐ด๐ด ร ๐ด๐ด | ๐๐ divides ๐๐
Is ๐ ๐ transitive?
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 27
28. Transitive Relations
Exercise: Let ๐ด๐ด = 1,2,3 and ๐ ๐ be the relation on ๐ด๐ด
whose matrix is
๐๐๐ ๐ =
1 1 1
0 0 1
0 0 1
Show that ๐ ๐ is transitive. (Hint: Check if ๐๐๐ ๐ โ
2
= ๐๐๐ ๐ )
Exercise: How is a transitive relation identified by its
matrix?
Exercise: How is a transitive relation characterized by the
digraph?
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 28
29. Equivalence Relations
Definition: A relation ๐ ๐ on a set ๐ด๐ด is called an equi-
valence relation if it is reflexive, symmetric and transitive.
Example: Let ๐ด๐ด = 1, 2, 3, 4 and let
๐ ๐ = 1,1 , 1,2 , 2,1 , 2,2 , 3,4 , 4,3 , 3,3 , 4,4 .
Then ๐ ๐ is an equivalence relation.
Example: Let ๐ด๐ด = โค and let
๐ ๐ = ๐๐, ๐๐ โ ๐ด๐ด ร ๐ด๐ด โถ ๐๐ โก ๐๐ mod 2 .
Show that ๐ ๐ is an equivalence relation.
ยฉ S. Turaev, CSC 1700 Discrete Mathematics 29