Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sets, Relations, and Lattices

Similar presentations


Presentation on theme: "Sets, Relations, and Lattices"— Presentation transcript:

1 Sets, Relations, and Lattices

2 Sets Set: collection of distinct objects
Example: attendees in this class; prime numbers Objects: elements, or members, of the set Set with no elements: empty, or null, set Set of all even numbers between 1 and 10: {2,4,6,8,10} Infinite set of all positive, even numbers: {2,4,6, …} Readers of the Kohavi-Jha book living in Antarctica: most likely empty

3 Set Definitions Universe U: set of all possible outcomes
Example: Rolling a die U = {f1, f2, f3, f4, f5, f6} U has 26 = 64 subsets Null, {f1}, …, {f6}, {f1,f2}, …, {f5,f6}, {f1,f2,f3}, …, U A=B: A and B are identical A B: A is a subset of B A B: A is a proper subset of B A+B: union of A and B AB: intersection of A and B A’: complement of A

4 Venn Diagrams

5 Ordered Pair Ordered pair (a,b): specific order associated with a and b a: first coordinate b: second coordinate Example: mother and daughter; teacher and student Example: {(a,a), (a,b), (b,a), (b,c), (c,a)} Generalization: Ordered n-tuple (a1, a2, …, an)

6 Binary Relation Binary relation R: set of ordered pairs (a,b)
a R b: a is related to b by R Cartesian product AxB: set of ordered pairs (a,b) s.t. a is in A and b is in B Example: If A = {p,q} and B = {r,s,t}, then AxB = {(p,r), (p,s), (p,t), (q,r), (q,s), (q,t)} Relation from set A to A: relation in A – subset of AxA or A2 Relation R in set A is Reflexive if it contains (a,a) for every a in A Symmetric if existence of (a,b) in R implies the existence of (b,a) Transitive if existence of (b,a) and (a,c) in R implies existence of (b,c)

7 Properties of Relations
Relation R in set A is Reflexive if it contains (a,a) for every a in A Symmetric if existence of (a,b) in R implies the existence of (b,a) Transitive if existence of (b,a) and (a,c) in R implies existence of (b,c) Example: Relation {(a,a), (b,b), (a,b)} – reflexive and transitive, but not symmetric Example: Relation {(a,b), (b,a)} – symmetric, but not transitive since it does not contain (a,a) Binary relation R in set S: equivalence relation if it is reflexive, symmetric and transitive Example: Relation = is an equivalence relation since it satisfies for all a, b, and c in R Reflexive: a = a Symmetric: If a = b, then b = a Transitive: If a = b and b = c, then a = c

8 Equivalence Classes Equivalence relation: partitions elements of a set into disjoint subsets s.t. all members of a subset are equivalent and members of different subsets are not equivalent Disjoint subsets: equivalence classes Example: Relation of parallelism between lines in a plane R = {(a,a), (b,b), (c,c), (d,d), (e,e), (f,f), (a,b), (b,a), (a,c), (c,a), (b,c), (c,b), (d,e), (e,d)} Equivalence classes: {a,b,c}, {d,e}, {f}

9 Compatibility Relation
Compatibility relation: relation that is reflexive and symmetric, but not transitive Nontransitivity nondisjoint subsets Subsets: compatibility classes Partition: Partition on set S: collection of disjoint subsets with set union S Disjoint subsets: blocks of partition Uniform partition: each block contains the same no. of elements Example: Equivalence relation for parallel lines induces partition {a,b,c; d,e; f} Function: set of ordered pairs in which no two pairs have same first coordinate Example: If A = {a,b,c} and B = {d,e} {(a,d), (b,e), (c,d)} is a function from A to B {(a,d), (b,e), (c,d), (c,e)} is not

10 Partially Ordered Sets
Partial ordering: reflexive, antisymmetric and transitive binary relation Example: For S = {a,b,c}, partial ordering satisfies Reflexive: a a Symmetric: a b and b a imply a=b Transitive: if a b and b c, then a c Partition on S “smaller than or equal to” than on S, denoted if each pair of elements in a common block of is also in a common block of two partitions incomparable if neither is smaller than or equal to the other Example: Consider S and its three partitions: S = {a,b,c,d,e,f,g,h,i} = {a,b; c,d; e,f; g,h,i} = {a,f; b,c; d,e; g,h; i} = {a,b,e,f; c,d; g,h,i} , but and are incomparable, as are and

11 Totally Ordered Sets Total ordering: if for every pair a,b in S, either or , then S is totally ordered by binary relation Example: Set of all prime numbers is totally ordered by Displaying the ordering relation with a Hasse diagram Example: Partial ordering displaying divisibility relation among all positive divisors of 45, such that the quotient is an integer Hasse diagram

12 Least/Greatest Member of a Set
Least member: if for every b in S, then a is called the least member of S When least member exists, it is unique Example: When the set does not have a least member, define minimal member Greatest member: if for every b in S, then a is called the greatest member of S When greatest member exists, it is unique When greatest member does not exist, define maximal member

13 Lower/Upper Bound of a Subset of Set S
Upper bound: Let S be partially ordered and P be a subset of S, then an element s in S is an upper bound of P if and only if, for every p in P, s is not necessarily a member of P Least upper bound (lub): smallest of all upper bounds Lower bound: Element s in S is an lower bound of P if and only if, for every p in P, Greatest lower bound (glb): largest of all lower bounds Example: S = {1,3,5,9,15,45} and P = {3,5} Upper bounds: 15, 45 lub: 15 glb = 1

14 Lattice Lattice: partially ordered set in which every pair of elements has a unique glb and a unique lub Least element: denoted as 0 Greatest element: denoted as 1 For each element a of lattice: and Example: Lattice Not a lattice

15 Lattice (Contd.) Example: Lattice of all subsets of set S = {a,b,c}, under the ordering relation of set inclusion, where {a,b,c} = 1 and = 0

16 Binary Operation Because of their uniqueness, lub and glb may be viewed as binary operations Sum a+b = lub(a,b) Product a.b = glb(a,b) lub and glb satisfy: Idempotency: a.a = a+a = a Commutativity: a.b = b.a and a+b = b+a Absorption: a+a.b = a and a.(a+b) = a Associativity: a.(b.c) = (a.b).c and a+(b+c) = (a+b)+c Following properties valid for every finite lattice: a+0 = a a.0 = 0 a.1 = a a+1 = 1

17 Partially Ordered Set Whose Elements are Partitions
Example: Let = {a,b; c,d,e; f,h; g,i} and = {a,b,c; d,e; f,g; h,i} = {a,b,c,d,e; f,g,h,i} = {a,b; c; d,e; f; g; h; i} = {a,b,c,d,e,f,g,h,i}: greatest partition with just one block = {a;b;c;d;e;f;g;h;i}: least partition with single-element blocks

18 Distributive Law Not Necessarily Valid
Lattice is distributive if and only if a.(b+c) = a.b+a.c a+(b.c) = (a+b)(a+c) Example: Consider = {a;b;c} = = {a,b;c} = {a;b,c} = {a,c;b} = {a,b,c} = Product , but , hence lattice not distributive

19 Complemented Lattice Lattice is said to be complemented, if for each element a, there exist a’ s.t. a.a’ = 0 a+a’ = 1 a’ is the complement of a and vice versa Example: Distributed and complemented lattice


Download ppt "Sets, Relations, and Lattices"

Similar presentations


Ads by Google