Discrete Mathematics Set
Sets Set = a collection of distinct unordered objects Members of a set are called elements How to determine a set Listing: Example: A = {1,3,5,7} Description Example: B = {x | x = 2k + 1, 0 < k < 3}
Finite and infinite sets Examples: A = {1, 2, 3, 4} B = {x | x is an integer, 1 < x < 4} Infinite sets Z = {integers} = {…, -3, -2, -1, 0, 1, 2, 3,…} S={x| x is a real number and 1 < x < 4} = [0, 4]
Some important sets The empty set has no elements. Also called null set or void set. Universal set: the set of all elements about which we make assertions. Examples: U = {all natural numbers} U = {all real numbers} U = {x| x is a natural number and 1< x<10}
Cardinality Cardinality of a set A (in symbols |A|) is the number of elements in A Examples: If A = {1, 2, 3} then |A| = 3 If B = {x | x is a natural number and 1< x< 9} then |B| = 9 Infinite cardinality Countable (e.g., natural numbers, integers) Uncountable (e.g., real numbers)
Subsets X is a subset of Y if every element of X is also contained in Y (in symbols X Y) Equality: X = Y if X Y and Y X X is a proper subset of Y if X Y but Y X Observation: is a subset of every set
Power set The power set of X is the set of all subsets of X, in symbols P(X), i.e. P(X)= {A | A X} Example: if X = {1, 2, 3}, then P(X) = {, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} If |X| = n, then |P(X)| = 2n.
Set operations: Union and Intersection Given two sets X and Y The union of X and Y is defined as the set X Y = { x | x X or x Y} The intersection of X and Y is defined as the set X Y = { x | x X and x Y} Two sets X and Y are disjoint if X Y =
Complement and Difference The difference of two sets X – Y = { x | x X and x Y} The difference is also called the relative complement of Y in X Symmetric difference X Δ Y = (X – Y) (Y – X) The complement of a set A contained in a universal set U is the set Ac = U – A In symbols Ac = U - A
Venn diagrams A Venn diagram provides a graphic view of sets Set union, intersection, difference, symmetric difference and complements can be identified
Properties of set operations (1) Theorem 2.1.10: Let U be a universal set, and A, B and C subsets of U. The following properties hold: a) Associativity: (A B) C = A (B C) (A B) C = A (B C) b) Commutativity: A B = B A A B = B A
Properties of set operations (2) c) Distributive laws: A(BC) = (AB)(AC) A(BC) = (AB)(AC) d) Identity laws: AU=A A = A e) Complement laws: AAc = U AAc =
Properties of set operations (3) f) Idempotent laws: AA = A AA = A g) Bound laws: AU = U A = h) Absorption laws: A(AB) = A A(AB) = A
Properties of set operations (4) i) Involution law: (Ac)c = A j) 0/1 laws: c = U Uc = k) De Morgan’s laws for sets: (AB)c = AcBc (AB)c = AcBc