Sets Section 2.1
Sets Set - a collection of unordered objects Element /member - an object in a set Two ways of describing a Set: Specifying the elements explicitly V = {a, e, i, o, u} Specifying the property/properties of the elements (Set Builder notation) P = {x | x is a positive integer less than 10}
Set membership and common sets a A a is an element of set A b A b is not an element of set A Some notations: N Set of natural numbers Z Set of integers Z+ Set of positive integers Q Set of rational numbers R Set of real numbers
Set Definitions Equal sets Two sets are equal iff they have the same elements Order means nothing Listing an object more than once does not change the set
Set Definitions (Cont..) Empty set or Null set Set that has no elements Denoted by or { } Singleton Set that has one element Example: A = {2}
Set Definitions (Cont..) The set A is a subset of B iff every element of A is also an element of B. A B The null set is a subset of every set. A Every set is a subset of itself. A A A is a proper subset of B, if A is a subset of B and A is not equal to B. A B
Set Definitions (Cont..) Cardinality The number of distinct elements in a set Denoted by |S|, for the set S
Power Set Power Set The set of all subsets of a set Denoted by P(S), for the set S If a set has n elements, then the power set has 2n elements, i.e., |P(S)| = 2|S|
Example Let L = {a, b, c, d} What is the cardinality of L? How many elements does the power set of L have? What is the power set of L?
Venn Diagram Universal set U is represented by rectangle Circles or other geometrical figures inside the rectangle represent sets B A U
Cartesian Product The Cartesian product of two sets A and B (denoted by A B) is the set of all ordered pairs (a,b) where a is an element of A and b is an element of B. A B = {(a,b) | aA bB} Example: A = {x, y, z} B = {1, 2} A B = {(x,1),(x,2),(y,1),(y,2),(z,1),(z,2)} B A = {(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}
Set Operations Section 2.2
Set Union Union of two sets A and B is denoted by AB AB contains elements that are either in A or in B or in both AB = {x | xA xB} A = {1,3,5}, B = {2,3,4} A B A AB = {1,2,3,4,5}
Set Intersection Intersection of two sets A and B is denoted by AB AB contains elements that are in both A and B AB = {x | xA xB} A = {1,3,5}, B = {1,2,3} A B AB = {1,3}
Disjoint Sets Two sets are called disjoint if their intersection is the empty set. A = {1,3,5}, B = {1,2,3}, C = {6,7,8} NO Are A and B disjoint? Are A and C are disjoint? YES A C
Cardinality of union of sets Exercise: How many elements does A U B have?? |AB| = |A|+|B|-|A B|
Set Difference Difference of two sets A and B is denoted by AB AB contains elements that are in A but not in B. AB = {x | xA xB} A = {1,3,5}, B = {1,2,3} A B A B AB = {5}
Complement of a Set U A Complement of a set A is denoted by Done with respect to a Universal set U contains elements that are not in A, but in U. U A = U A = {x | xU xA}
Set Identities A A Identity A U A A U U Domination A A A Idempotent A A A = A Double Complement
Set Identities (Cont ..) A B B A Commutative A B B A A (B C) (A B) C Associative A (B C) (A B) C A (B C) (A B) (A C) Distributive A (B C) (A B) (A C) A (A B) A Absorption A (A B) A De Morgan's
Examples Use set builder notation to prove that Use set identities to prove that
More Exercises Describe the following sets using the set builder notation: 1. The set of all positive integers between 1 and 99. 2. 3. 4. 5. Use set builder notation to prove .