Sets What's a set? 1. collection of objects 2. no duplicates 3. no order What symbol indicates an object is a member of a set? What brackets are used for a set? How do you define the members of a Set? 1. enumerate: S = {1, 2, 4, 8} 2. ellipsis: S = {1, 4, 9, 16, ..., 256} 3. set builder: { x | x in S and P(x) } What's the Empty Set? 1. set with no members 2. notation is {} (or circle with slash) Set Equality What does it mean for two sets to be Equal? 1. two sets are equal if they have the same members 2. order doesn't matter What does it mean to say that A is a subset of B? 1. every member of A is a member of B 2. if x is a member of A, x is a member of B What does it mean to say that A is a proper subset of B? A is a subset of B and A is not equal to B If A sub B and B sub A, what's true about sets A and B? A and B are equal if and only if A sub B and B sub A Set Operations What are the Set Operations and their Symbols? A union B set of elements in A OR B or both A intersect B set of elements in both A AND B A - B set of elements in A but not in B ~A set of elements not in A (or U - A) Set Identities A union {} = A Identity A intersect U = A Identity A union U = U Domination A intersect {} = {} Domination A union A = A Idempotent A intersect A = A Idempotent A union B = B union A Commutative A intersect B = B intersect A Commutative A un (B un C) = (A un B) un C Associative A int (B int C) = (A int B) int C Associative A un (B int C) = (A un B) int (A un C) Distributive A int (B un C) = (A int B) un (A int C) Distributive ~(A union B) = ~A intersect ~B DeMorgan's ~(A intersect B) = ~A union ~B DeMorgan's A union (A int B) = A Absorption A int (A union B) = A Absorption A union ~A = U Complement A intersect ~A = {} Complement Tuples How do you pronounce the word tuple? What's an ordered pair? ordered list of two objects What's an ordered n-tuple? ordered list of n objects What brackets are used for an ordered pair? Cartesian Product What's the Cartesian Product of two sets A and B? set of pairs with first item from A, second from B A x B = {(a,b) | a in A and b in B} Compute the Cartesian Product of A and B. A = {1,2} B = {a,b,c} A x B = {(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)} What's the n-way Cartesian Product of n sets A1, A2, ..., An? A1 x A2 x ... x An = {(a1,a2,...,an) | a1 in A1, a2 in A2, ..., an in An} Compute the Cartesian Product of A, B, and C. A = {1,2} B = {a,b,c} C = {jim, bob} A x B x C = {(1,a,jim),(1,a,bob),(1,b,jim),(1,b,bob), (1,c,jim),(1,c,bob),(2,a,jim),(2,a,bob), (2,b,jim),(2,b,bob),(2,c,jim),(2,c,bob)} Cardinality What's the Cardinality of a set? the cardinality of set A is the number of elements in A What's the notation for Cardinality? What's the Cardinality of the Cartesian Product? |A X B| = |A| * |B| Classwork You may work with a partner. Evaluate each expression: U = {a,b,c,d,e,f,g,h,j} A = {a,b,c,d,e,f} B = {b,c,e,g,h,j} A union B A intersect B A - B ~A A subset B |A X B|