Set and Set Operations

advertisement
Set and Set Operations
CMPS 2433- Chapter 2
Partially borrowed from Florida State University and
Dr. R Halverson
Introduction
• A set is a collection of objects
• The order of the elements does not matter
• Objects in a set are called elements
• A well – defined set is a set in which we
can determine if an element belongs to
that set.
• Examples:
• The set of all movies in which John Wayne appears is
well – defined.
• The set of all courses taught by Dr. Halverson
• The set of best TV shows of all time is not well –
defined. (It is a matter of opinion.)
Notation
• Usually denote a set with a capital letter.
• Roster notation is the method of describing
a set by listing each element of the set.
• Example: Let C = set of all even integers less
than 12 but greater than zero.
• C = {2, 4, 6, 8, 10} = {10, 6, 8, 4, 2}
• Example: Let T = set of all courses taught by
Dr. Halverson in summer 2014.
• T = {CMPS 1013}
More on Notation
• Sometimes impossible list all elements of a
set.
• Z = The set of integers . The dots mean
continue on in this pattern forever and
ever.
• Z = { …-3, -2, -1, 0, 1, 2, 3, …}
• Dots can ONLY be used if the pattern is
unmistakable
• W = {0, 1, 2, 3, …} = the set of whole
numbers.
Set – Builder Notation
• Set-Builder Notation: specify the rule that
determines set membership
• First: indicate type of elements in set
• Second: specify distinguishing rule
• V = { people | citizens registered to vote in
Wichita County}
• A = {x is a real number | x > 5}
• The symbol | is read as “such that”
Special Sets of Numbers
• N = The set of natural numbers.
= {1, 2, 3, …}.
• W = The set of whole numbers.
={0, 1, 2, 3, …}
• Z = The set of integers.
= { …, -3, -2, -1, 0, 1, 2, 3, …}
• Q = The set of rational numbers.
={x| x=p/q, where p and q are elements of Z and
q≠0}
• H = The set of irrational numbers.
• R = The set of real numbers.
• C = The set of complex numbers.
Universal Set and Subsets
• Universal Set (denoted by U) - set of all possible
elements used in a problem
• Universal set  Whole numbers (if counting)
• Universal set  Rational numbers (if measuring)
• Subset: B  A if every element of B is also an
element A
• Example A={1, 2, 3, 4, 5} and B={2, 3}
Let S={1,2,3}, list all the subsets of S.
• The subsets of S are  , {1}, {2}, {3}, {1,2}, {1,3}, {2,3},
{1,2,3}.
The Empty Set
• Empty Set: set containing no elements; zero

elements
• denoted as { } or
• Empty Set  of all sets
• Do not be confused by this question:
• Is this set {0} empty?
• It is not empty! It contains one element - zero
Intersection of sets
• Intersection of sets A & B is denoted
A∩B
• A ∩ B = {x| x is an element of A and x
is an element of B}
• A={1, 3, 5, 7, 9} & B={1, 2, 3, 4, 5}
• A ∩ B = {1, 3, 5}
• B ∩ A = {1, 3, 5}
Union of sets
• Union of two sets A, B is denoted A U B and
is defined A U B = {x| x is in A or x is in B}
• A={1, 3, 5, 7, 9} & B={1, 2, 3, 4, 5}
• A U B = {1, 2, 3, 4, 5, 7, 9}.
• NOTE:
• Order of listing sets does not matter
• Never repeat elements
Difference of Sets
• Difference of sets A & B denoted A-B
• A-B = {x|x is in A but x is NOT in B}
• Like subtraction
• A={1, 3, 5, 7, 9} & B={1, 2, 3, 4, 5}
• A-B = {7, 9}
• B-A = {2, 4}
Mutually Exclusive Sets
• Two sets A and B are Disjoint (aka
Mutually Exclusive) if A ∩ B = 
• I.E. No elements in common
• Think of this as two events that can
not happen at the same time.
Complement of a Set
• Complement of set A is denoted by Ᾱ or
c
by A
• Ᾱ = {x | x is in the universal set but x is
not in set A}
• U={1,2,3,4,5} & A={1,2},
• Ᾱ = {3,4,5}
Cardinal Number
• Cardinality of a set is the number of
elements in the set and is denoted by
|A| or n(A)
• A={2,4,6,8,10}, then |A|=5.
• Cardinality formula
• |A U B|=|A| + |B| – |A∩B|
• |{ } | = ???
(Cardinality of the empty set?)
Theorem 2.1 (pg. 43)
• Commutative Law
• A U B = B U A and B ∩ A = A ∩ B
• Associative Law
• (A U B) U C = A U (B U C)
• (A ∩ B) ∩ C = A ∩ (B ∩ C)
• Distributive Law
• A U (B ∩ C) = (A U B) ∩ (A U C)
• A U (B ∩ C) = (A ∩ B) U (A ∩ C)
• See others on Page 43
Ordered Pair
• An Ordered Pair of elements a & b is
denoted (a,b)
• Order is significant
• (a,b) ≠ (b,a)
Cartesian Product
• Cartesian Product of sets A & B
• Denoted A X B
• is the set consisting of all ordered pairs
(a,b) where a is an element of A and b is
an element of B
• A X B = { (a,b)| a is in A & b is in B}
• If |A| = 3 and |B| = 7, what is |A X B|?
• Can you list them?
De Morgan’s Laws (pg. 45)
• See Page 45 – Memorize
• Study Proofs also!
• And YOU prove the part not proven in the
book
Homework – 2.1
• Pages 46 & 47
• 1-8, 13-28
Download