Successfully reported this slideshow.
Upcoming SlideShare
×

of

Upcoming SlideShare
Chapter 2: Relations
Next

5

Share

# Relations digraphs

discrete math

See all

See all

### Relations digraphs

1. 1. Relations & Digraphs
2. 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. 3. Product Sets Example: Let π΄π΄ = 1,2,3 and π΅π΅ = ππ, π π  , then π΄π΄ Γ π΅π΅ = π΅π΅ Γ π΄π΄ = Β© S. Turaev, CSC 1700 Discrete Mathematics 3
4. 4. Product Sets Theorem: For any two finite sets π΄π΄ and π΅π΅, π΄π΄ Γ π΅π΅ = π΄π΄ β π΅π΅ . Proof: Use multiplication principle! Β© S. Turaev, CSC 1700 Discrete Mathematics 4
5. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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
20. 20. Paths in Relations & Digraphs Example: Let π΄π΄ = ππ, ππ, ππ, ππ, ππ and ππ = ππ, ππ , ππ, ππ , ππ, ππ , ππ, ππ , ππ, ππ , ππ, ππ . ππππ = 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 Compute ππππ2. Β© S. Turaev, CSC 1700 Discrete Mathematics 20
21. 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. 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. 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. 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. 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. 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. 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. 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. 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
30. 30. Exercises : Relations Β© S. Turaev, CSC 1700 Discrete Mathematics 30
31. 31. Exercises : Relations Β© S. Turaev, CSC 1700 Discrete Mathematics 31
32. 32. Exercises : Relations Β© S. Turaev, CSC 1700 Discrete Mathematics 32

Jul. 5, 2021
• #### RichaKochar3

Jun. 30, 2021

Mar. 3, 2021
• #### tasalghamdi

Dec. 15, 2016
• #### abhishekfromup

Aug. 21, 2016

discrete math

Total views

19,219

On Slideshare

0

From embeds

0

Number of embeds

4

198

Shares

0