Discrete Mathematics Set Sets Set a collection of

  • Slides: 14
Download presentation
Discrete Mathematics Set

Discrete Mathematics Set

Sets Set = a collection of distinct unordered objects p Members of a set

Sets Set = a collection of distinct unordered objects p Members of a set are called elements p How to determine a set p n Listing: p n Example: A = {1, 3, 5, 7} Description p Example: B = {x | x = 2 k + 1, 0 < k < 3}

Finite and infinite sets p Finite sets n Examples: A = {1, 2, 3,

Finite and infinite sets p Finite sets n Examples: A = {1, 2, 3, 4} q B = {x | x is an integer, 1 < x < 4} q q Infinite sets q Examples: Z = {integers} = {…, -3, -2, -1, 0, 1, 2, 3, …} q S={x| x is a real number and 1 < x < 4} = [0, 4] q

Some important sets The empty set has no elements. Also called null set or

Some important sets The empty set has no elements. Also called null set or void set. q Universal set: the set of all elements about which we make assertions. q Examples: p n n n U = {all natural numbers} U = {all real numbers} U = {x| x is a natural number and 1< x<10}

Cardinality of a set A (in symbols |A|) is the number of elements in

Cardinality of a set A (in symbols |A|) is the number of elements in A p Examples: p If A = {1, 2, 3} then |A| = 3 If B = {x | x is a natural number and 1< x< 9} then |B| = 9 p Infinite cardinality n n Countable (e. g. , natural numbers, integers) Uncountable (e. g. , real numbers)

Subsets p X is a subset of Y if every element of X is

Subsets p X is a subset of Y if every element of X is also contained in Y (in symbols X Y) q Equality: X = Y if X Y and Y X p X is a proper subset of Y if X Y but Y X n Observation: is a subset of every set

Power set p The power set of X is the set of all subsets

Power set p The power set of X is the set of all subsets of X, in symbols P(X), n n q 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)| = 2 n.

Set operations: Union and Intersection Given two sets X and Y p The union

Set operations: Union and Intersection Given two sets X and Y p The union of X and Y is defined as the set X Y = { x | x X or x Y} q 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 p The difference of two sets X – Y = {

Complement and Difference p 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) q The complement of a set A contained in a universal set U is the set Ac = U – A q In symbols Ac = U - A

Venn diagrams A Venn diagram provides a graphic view of sets p Set union,

Venn diagrams A Venn diagram provides a graphic view of sets p Set union, intersection, difference, symmetric difference and complements can be identified p

Properties of set operations (1) Theorem 2. 1. 10: Let U be a universal

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 (B C) = (A B)

Properties of set operations (2) c) Distributive laws: A (B C) = (A B) (A C) d) Identity laws: A U=A A = A e) Complement laws: A Ac = U A Ac =

Properties of set operations (3) f) Idempotent laws: A A = A g) Bound

Properties of set operations (3) f) Idempotent laws: A A = A g) Bound laws: A U = U h) Absorption laws: A (A B) = A A A = A A = A (A B) = A

Properties of set operations (4) i) Involution law: (Ac)c = A j) 0/1 laws:

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: (A B)c = Ac Bc