Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relations (3) Rosen 6th ed., ch. 8 2008 fall.

Similar presentations


Presentation on theme: "Relations (3) Rosen 6th ed., ch. 8 2008 fall."— Presentation transcript:

1 Relations (3) Rosen 6th ed., ch. 8 2008 fall

2 Partial ordering A relation R is a partial ordering if it is reflexive, antisymmetric, and transitive. Example ‘greater than or equal to’ ‘is a subset of’ 1 2 3 Greater than or equal to, on {1,2,3}

3 Example (Partial ordering)
Is subset of A ={ a, b, c} P(A) = { {}, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c} } Partial ordering : 부분적으로 순서화, {a,b}와 {b,c} 사이에는 is-subset-of로 순서화 할 수 없다. {} {a,b,c} {a} {b} {c} {a.b} {a,c} {b,c} Í 2008 fall

4 Example (Partial ordering)
EXAMPLE 2: The divisibility relation | is a partial ordering on the set of positive integers, because it is reflexive, antisymmetric, and transitive. EXAMPLE 4: Let R be the relation on the set of people such that xRy if x and y are people and x is older than y. Show that R is not a partial ordering. Solution: No person is older than himself of herself. So this R is not reflective. 2008 fall

5 Comparability The elements a and b of a poset (S, ≤) are called comparable if either a ≤ b or b ≤ a. When a and b are elements of S such that neither a ≤ b nor b ≤ a are called incomparable. EXAMPLE 5: In the poset (Z+, |), are the integers 3 and 9 comparable? Are 5 and 7 comparable? Solution: Yes for 3 and 9, No for 5 and 7. 2008 fall

6 Totally Ordered Relation
If (S, ≤) is a poset and every two elements of S are comparable, S is called a totally ordered or linearly ordered set, and ≤ is called total order or a linear order. A totally ordered set is also called a chain. EXAMPLE 6: The poset (Z+, ≤) is totally ordered because a ≤ b or b ≤ a whenever a and b are integers. EXAMPLE 7: The poset (Z+, |) is not totally ordered because it contains elements that are incomparable, such as 5 and 7. 2008 fall

7 Lexicographical order
Example : 사전의 단어 순서

8 Hasse Diagrams Start with the directed graph of a relation.
Remove loops. Remove all edges that must be in the partial ordering because of the presence of other edges and transitivity. Remove all the arrows. All edges point “upward” toward their terminal vertex. See Figure 2 of page 571. 2008 fall

9 Hasse Diagrams EXAMPLE 12: Draw the Hasse diagram representing the partial ordering {(a, b) | a divides b} on {1, 2, 3, 4, 6, 8, 12} => see FIGURE 3 of page 572. EXAMPLE 13: Draw the Hasse diagram representing the partial ordering {(A, B) | A  B} on the power set P(S) where S = {a, b, c} => see FIGURE 4 of page 573. 2008 fall

10 Maximal and Minimal Elements
An element of a poset is called maximal if it is not less than any element of the poset. Similary, an element of a poset is called minimal if it is not greater than any element of the poset. EXAMPLE 14: Which elements of the poset ({2, 4, 5, 10, 12, 20, 25}, |) are maximal, and which are minimal? Solution: 12, 20, and 25 are maximal and 2 and 5 are minimal. 2008 fall

11 Greatest and Least Elements
An element of a poset is called greatest element if it is greater than all the other elements in the poset. Similary, an element of a poset is called least element if it is less than all the other elements in the poset. EXAMPLE 17: Is there a greatest element and a least element in the poset (Z+, |) ? Solution: The integer 1 is the least element because 1|n whenever n is a positive integer. Because there is no integer that is divisible by all positive integers, there is no greatest element. 2008 fall

12 Example EXAMPLE 15: Determine whether the posets represented by following Hasse diagrams have greatest element and a least element. g: a, l: x g: x, l: x g: d, l: x g: d, l: a c a b d c a b e d c a b d b c a d 2008 fall

13 Upper Bound and Lower Bound
If u is an element of a poset (S, ≤) such that a ≤ u for all elements a  A(A  S), then u is called an upper bound of A. Likewise, if l is element of a poset (S, ≤) such that l ≤ a for all elements a  A(A  S), then l is called an lower bound of A. EXAMPLE 18: Find the lower and upper bounds of the subsets {a, b, c}, {j, h}, and {a, c, d, f} in the poset with the Hasse diagram shown in Figure 7. 2008 fall

14 Example Solution: {a, b, c}: u-b is e, f, j, and h. l-b is a. {j, h}:
no u-b. l-b is a, b, c, d, e, and f. {a, c, d, f}: u-b is f, h, and j. l-b is a Fig. 7. f j h g e b c a d 2008 fall

15 Upper Bound and Lower Bound Cont.
The element x is called the least upper bound of the subset A if x is an upper bound that is less than every other upper bound of A. Similarly, the element y is called the greatest lower bound of the subset A if y is a lower bound that is greater than every other lower bound of A. EXAMPLE 19: Find the greatest lower bound and the least upper upper bound of {b, d, g}, if they exist, in the poset shown in Fig. 7. Solution: g and b. 2008 fall

16 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. EXAMPLE 22: Is the poset (Z+, |) a lattice? Solution: a와 b를 두 정수라 하자. 이 두 정수의 최소공배수와 최대공약수가 각각 최소상한계와 최대하한계이므로, 이 poset은 격자이다. 2008 fall

17 Example EXAMPLE 21: 아래 하세 도표들로 표현되는 부분 순서 집합들이 격자(lattice)인지 판별하시오. (a) (b) (c) (a), (c)는 격자, (b)는 b와 c가 최소상한계를 가지지 않으므로 격자가 아니다. d, e, f가 이들의 상한계이지만, 이들 중 어느 것도 나머지 둘 보다 모두 작지는 않다. (Information flow에 활용) Study EXAMPLE 23. c b d e f a f d c b e g h a e a c d b f 2008 fall

18 Topological Sorting A total ordering is said to be compatible with the partial ordering R if a ≤ b whenever aRb. Constructing a compatible total ordering from a partial ordering is called topological sorting. EXAMPLE 26: Find a compatible total ordering for the poset ({1, 2, 4, 5, 12, 20}, |). Solution: 1 < 5 < 2 < 4 < 20 < 12. Study EXAMPLE 27. 2008 fall

19 Algorithm for Topological Sorting
ALGORITHM Topological Sorting Procedure topological sort((s, ≤): finite poset) k := 1 while S ≠ Ф begin ak := a minimal element of S S := S – {ak} k := k + 1 end {a1, a2, …, an is a compatible total ordering of S} 2008 fall


Download ppt "Relations (3) Rosen 6th ed., ch. 8 2008 fall."

Similar presentations


Ads by Google