1 Section 4.3 Order Relations A binary relation is an partial order if it transitive and antisymmetric. If R is a partial order over the set S, we also.

Slides:



Advertisements
Similar presentations
Partial Orderings Section 8.6.
Advertisements

Chapter 2 Revision of Mathematical Notations and Techniques
CSCI 115 Chapter 6 Order Relations and Structures.
Relations Relations on a Set. Properties of Relations.
Equivalence, Order, and Inductive Proof
1 Chapter Equivalence, Order, and Inductive Proof.
8.6 Partial Orderings. Definition Partial ordering– a relation R on a set S that is Reflexive, Antisymmetric, and Transitive Examples? R={(a,b)| a is.
Discrete Structure Li Tak Sing( 李德成 ) Lectures
Chapter 7 Relations : the second time around
1 Relations: The Second Time Around Chapter 7 Equivalence Classes.
Administrative stuff Office hours: After class on Tuesday.
Relations binary relations xRy on sets x  X y  Y R  X  Y Example: “less than” relation from A={0,1,2} to B={1,2,3} use traditional notation 0 < 1,
Partial Orderings: Selected Exercises
Section 7.6: Partial Orderings Def: A relation R on a set S is called a partial ordering (or partial order) if it is reflexive, antisymmetric, and transitive.
1 Partial Orderings Based on Slides by Chuck Allison from Rosen, Chapter 8.6 Modified by.
Partially Ordered Sets (POSets)
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Relations (3) Rosen 6th ed., ch fall.
Chapter 6. Order Relations and Structure
Chapter Relations and Their Properties 8.2 n-ary Relations and Their Applications 8.3 Representing Relations 8.4 Closures of Relations 8.5 Equivalence.
1 Partial Orderings Aaron Bloomfield CS 202 Rosen, section 7.6.
Discrete Structure Li Tak Sing( 李德成 ) Lectures 16,17,18,19 1.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Discrete Structures – CNS2300
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Chapter Elementary Notions and Notations.
1 Chapter 1 Introduction to the Theory of Computation.
Discrete Math for CS Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
8.3 Representing Relations Directed Graphs –Vertex –Arc (directed edge) –Initial vertex –Terminal vertex.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Relations and their Properties
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Mathematical Preliminaries
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
1 Partial Orderings Aaron Bloomfield CS 202 Epp, section ???
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
1 Section 4.2 Equivalence Relations A binary relation is an equivalence relation if it has the three properties reflexive, symmetric, and transitive (RST).
1 Partial Orderings Based on Slides by Chuck Allison from Rosen, Chapter 8.6 Modified by.
Partial Order Relations Lecture 50 Section 10.5 Wed, Apr 20, 2005.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
1 Section 4.4 Inductive Proof What do we believe about nonempty subsets of N? Since  N, <  is well-founded, and in fact it is linear, it follows that.
1 Partial Orderings Epp, section Introduction An equivalence relation is a relation that is reflexive, symmetric, and transitive A partial ordering.
Partial Orderings: Selected Exercises
Chapter 6 Order Relations and Structures
CSE 2813 Discrete Structures
Partial Orders.
Partial Orderings CSE 2813 Discrete Structures.
Partial Orders (POSETs)
CSE15 Discrete Mathematics 05/03/17
Introduction to Relations
Relations Binary relations represent relationships between the elements of two sets. A binary relation R from set A to set B is defined by: R  A 
Equivalence Relations
Relations Chapter 9.
Partial Orderings.
Aaron Bloomfield CS 202 Epp, section ???
Discrete Math (2) Haiming Chen Associate Professor, PhD
Partial Orders Section 9.6 of Rosen Spring 2018
Background material.
교환 학생 프로그램 내년 1월 중순부터 6월 초 현재 학부 2,3 학년?
Background material.
Relations: The Second Time Around
Presentation transcript:

1 Section 4.3 Order Relations A binary relation is an partial order if it transitive and antisymmetric. If R is a partial order over the set S, we also say, “S is a partially ordered set” or “S is a poset”. To emphasize both S and R we write  S, R  and call it a poset. Example. Here are five sample posets.  N, ≤ ,  N, < ,  N, divides ,  power({a, b, c}),  , and  Steps_of_a_Recipe, R  where i R j iff step i is done before step j. Comparability. Let  S, R  be a poset. Then we have the following definitions. 1. x, y  S are comparable if x R y or y R x. 2. If all pairs of elements are comparable, then R is a total (or linear) order. 3. A chain is a set of elements that are comparable to each other. Notation. We’ll often use the symbols < and ≤ as general symbols for partial orders. If x < y, say “x precedes y” or “x is a predecessor of y” or “y is a successor of x.” {a, b, c} {a, b} {a, c} {a}{a} {b, c} {b}{b}{c}{c}  An element x is an immediate predecessor of y or y is an immediate successor of x if {z | x < z < y} = . Poset Diagram (Hasse Diagram): A graph representing a poset but with only immediate predecessor edges, and the edges are oriented up from x to y when x < y. Example. The poset  power({a, b, c}),   has the poset diagram shown in the picture.

2 Minima, Maxima, and Bounds. Let S be a subset of a poset P. An element x  S is a minimal element of S if it has no predecessors in S. A minimal element x  S is the least element of S if x ≤ y for all y  S. An element x  P is a lower bound of S if x ≤ y for all y  S. A lower bound x of S is the greatest lower bound of S, denoted glb(S), if y ≤ x for all lower bounds y of S. There are corresponding definitions for maximal element of S, greatest element of S, upper bound of S, and least upper bound of S, lub(S). Quiz (2 minutes). Find the minima, maxima, and bounds for the subset S ={6, 7, 8} of the poset P pictured poset diagram P S {a, b, c} {a, b} {a, c} {a}{a} {b, c} {b}{b}{c}{c}  P S Example. Let P = power({a, b, c}) shown in the picture and let S = {{a}, {a, b}, {a, c}}. Then {a} is the only minimal element of S, so {a} is the least element of S. The lower bounds of S are {a} and , with glb(S) = {a}. The maximal elements of S are {a, b} and {a, c}, but there is no greatest element of S. The only upper bound of S is {a, b, c}, so lub(S) = {a, b, c}. Solution. The minimal elements of S are 6 and 7, but there is no least element of S. The lower bounds of S are 1, 2, 4 with glb(S) = 4. The only maximal element of S is 8, so 8 is also the greatest element of S. The upper bounds of S are 8 and 9, with lub(S) = 8.

3 Example. For any set S the poset  power(S),   is a lattice because for any sets A and B, we have glb(A, B) = A  B and lub(A, B) = A  B. Example/Quiz. Is  {1, 2, 3, 4, 5, 6}, |  a lattice? Answer: No. For example, there is no lub for 2 and 5. Quiz. Is  {1, 2, 3, 6, 12}, |  a lattice? Answer: Yes Algorithm. A typical algorithm keeps track of the number p(x) of immediate predecessors and the set s(x) of immediate successors of each element x, and the set Sources = {x | p(x) = 0}. while Sources ≠  do Output a source x and remove it from Sources; Decrement p(y) for each y  s(x) and update Sources od Example. The poset pictured has several possible topological sorts. The initial sources are 1, 2, 3. If we output 3, then the sources become 1, 2, 5. Two possible topological sorts are: 3, 5, 2, 1, 4, 7, 6, 8, 9 and 1, 2, 4, 6, 3, 5, 7, 8, 9. x y glb(x, y) lub(x, y) Lattices A lattice is a poset for which every pair of elements has a glb and a lub. Topological Sorting (Sorting a Poset) The idea is to output a minimal element and then remove it from the poset diagram and continue the process with the modified poset. The resulting output will always have the property that x is output before y if x < y.

4 Well-Founded Orders A poset is well-founded if every nonempty subset has a minimal element or, equivalently, every descending chain of elements x 1 > x 2 > … is finite. To see the equivalence, notice that if all descending chains are finite, then the last element must be minimal. And, if all nonempty subsets have minimal elements, then you can’t find a descending chain that goes forever since it would contradict minimality. Example. The posets  N, <  and  power(finite set),   are well-founded. Example. The posets  Z, <  and  power(infinite set),   are not well-founded. For example, an infinite descending chain in power(N) is N  N – {0}  N – {0, 1}  N – {0, 1, …, n}  … Lexicograpic Ordering of N n The lexicographic ordering on n-tuples is defined by (x 1, …, x n ) < (y 1, …, y n ) iff x 1 < y 1 or (x i = y i for 1 ≤ i < j and x j < y j ). This ordering is well-founded. Notice that it is also linear. Example Proof: We’ll show the lexicographic ordering on N 2 = N  N is well-founded. First, notice that any descending chain of the form (x, y 1 ) > (x, y 2 ) > … must stop since y 1 > y 2 > … is a finite descending chain in N. To continue such a chain the first argument of a pair must decrease at some point. For example, (x 1, y 1 ) > (x 2, y 2 ) where x 1 > x 2. But there are only finitely many such changes possible because x 1 > x 2 > … is a finite descending chain in N. So the lexicographic ordering on N 2 is well-founded. QED

5 Lexicograpic Ordering of A* Let A be an alphabet with some agreed upon ordering. If x and y are strings over A, then x < y iff either x is a proper prefix of y (i.e., y = xz with z ≠  ) or x and y have a longest common proper prefix u such that x = uw and y = uz, and head(w) < head(z) in A. NOTE: This is the usual dictionary ordering of strings and it is NOT well-founded, although it is a total order. For example, we have the following infinite descending chain of strings over {a, b} where we assume that a < b: b > ab > aab > aaab > … Quiz (1 minute). Order all strings of length 3 over {a, b} where a < b. Answer: aaa < aab < aba < abb < baa < bab < bba < bbb. Standard Ordering of A* This is a well-founded ordering that orders strings by length and uses lexicographic for strings of the same length. Example. Here is the longest descending chain starting from aaa over {a, b} where a < b: aaa > bb > ba > ab > aa > b > a > . A Simple Construction Technique for Well-Founded Orders Any function ƒ : S  N defines a well-founded order on S by x < y iff ƒ(x) < ƒ(y). Example. Lists are well-founded by length. Binary trees are well-founded by depth, by number of nodes, or by number of leaves. Z is well-founded by absolute value. Derivations for a grammar are well-founded by length. These orders are nonlinear.

6 Example. Let ƒ : Z  N be defined by ƒ(x) = if x ≥ 0 then 2x else –2x – 1. The ordering on Z defined by x < y iff ƒ(x) < ƒ(y) is well-founded and linear: 0 < –1 < 1 < –2 < 2 < …. Well-Founded Orders for Inductively Defined Sets If S is an inductively defined set and no two elements are defined in terms of each other, then the following methods can be used to establish a well-founded order for S. Method A. Define ƒ : S  N by ƒ(b) = 0 for each basis element b; and if x is defined in terms of y 1, …, y n, then ƒ(x) = 1 + max{ƒ(y 1 ), …, ƒ(y n )}. Define x < y iff ƒ(x) < ƒ(y). Method B. The basis elements are the minimal elements of S and if x is defined in terms of y 1, …, y n, then set y i < x for each i. Now take the transitive closure of the this ordering. Example. The set Z can be defined inductively by: Basis: 0  Z Induction: x  Z implies x + 1, x – 1  Z. Notice that 1 and –1 are constructed from 0 but 0 is also constructed from –1. So neither technique builds a poset. Example. The set N 2 can be defined inductively by: Basis: (0, 0)  N 2 Induction: (x, y)  N 2 implies (x, y + 1), (x + 1, y)  N 2. In the ordering constructed by method A any pair (x, y) has n + 2 immediate successors if x + y = n. For example, the the immediate successors of (0, 1) are (0, 2), (1, 1) and (2, 0). In the ordering constructed by method B any pair (x, y) has exactly 2 immediate successors. For example, the the immediate successors of (0, 1) are (0, 2) and (1, 1).