Upload
pocong-makenon
View
109
Download
1
Embed Size (px)
Citation preview
Product SetsDefinition: An ordered pair ππ, ππ is a listing of the objects/items ππ and ππ in a prescribed order: ππ is the firstand ππ 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
Product SetsExample: Let π΄π΄ = 1,2,3 and π΅π΅ = ππ, π π , then
π΄π΄ Γ π΅π΅ =
π΅π΅ Γ π΄π΄ =
Β© S. Turaev, CSC 1700 Discrete Mathematics 3
Product SetsTheorem: For any two finite sets π΄π΄ and π΅π΅,
π΄π΄ Γ π΅π΅ = π΄π΄ β π΅π΅ .
Proof: Use multiplication principle!
Β© S. Turaev, CSC 1700 Discrete Mathematics 4
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
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
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
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
Relations & DigraphsExample 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
The Matrix of a RelationDefinition: 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
The Digraph of a RelationDefinition: 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
The Digraph of a RelationExample: 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
The Digraph of a RelationDefinition: 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
The Digraph of a RelationExample: Let π΄π΄ = ππ, ππ, ππ,ππ and let π π be the relation on π΄π΄ that has the matrix
πππ π =1 00 1
0 00 0
1 10 1
1 00 1
Construct the digraph of π π and list in-degrees and out-degrees of all vertices.
Β© S. Turaev, CSC 1700 Discrete Mathematics 14
The Digraph of a RelationExample: Let π΄π΄ = 1,4,5 and let π π be given the digraph
Find πππ π and π π .
Β© S. Turaev, CSC 1700 Discrete Mathematics
1 4
5
15
Paths in Relations & DigraphsDefinition: 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
Paths in Relations & DigraphsExample: Give the examples for paths of length 1,2,3,4and 5.
Β© S. Turaev, CSC 1700 Discrete Mathematics
1 2
43
5
17
Paths in Relations & DigraphsDefinition: 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
Paths in Relations & DigraphsLet π π 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
Paths in Relations & DigraphsExample: Let π΄π΄ = ππ, ππ, ππ,ππ, ππ and
π π = ππ, ππ , ππ, ππ , ππ, ππ , ππ, ππ , ππ,ππ , ππ, ππ .
πππ π =
1 10 0
0 01 0
00
000
000
000
100
110
Compute πππ π 2.
Β© S. Turaev, CSC 1700 Discrete Mathematics 20
Reflexive & Irreflexive RelationsDefinition:
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
Reflexive & Irreflexive RelationsExercise: 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
(A-, Anti-) Symmetric RelationsDefinition:
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
(A-, Anti-) Symmetric RelationsExample: Let π΄π΄ = 1, 2, 3, 4, 5, 6 and let
π π = ππ, ππ β π΄π΄ Γ π΄π΄ | ππ < ππ
Is π π symmetric, asymmetric or antisymmetric?
Symmetry:
Asymmetry:
Antisymmetry:
Β© S. Turaev, CSC 1700 Discrete Mathematics 24
(A-, Anti-) Symmetric RelationsExample: 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
(A-, Anti-) Symmetric RelationsExercise: 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
Transitive RelationsDefinition: 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
Transitive RelationsExercise: Let π΄π΄ = 1,2,3 and π π be the relation on π΄π΄whose matrix is
πππ π =1 1 10 0 10 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
Equivalence RelationsDefinition: 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