4 Sets
4 Sets
Summary
Fundamentals of Sets
Set Operations
Computer Representation of Sets
Partitions of Sets
Section Summary
Definition of sets
Describing Sets
Roster Method
Set-Builder Notation
Some Important Sets in Mathematics
Empty Set and Universal Set
Subsets and Set Equality
Tuples
Cartesian Product
Russell’s Paradox
Introduction
Sets are one of the basic building blocks for the types
of objects considered in discrete mathematics.
Important for counting.
Examples:
1. The set of all computer science majors at your institute is a
subset of all students at your institute.
2. The set of integers with squares less than 100 is not a
subset of the set of nonnegative integers.
Another look at Equality of Sets
Recall that two sets A and B are equal, denoted by
A = B, iff
This is equivalent to
A⊆B and B⊆A
Proper Subsets
Definition: If A ⊆ B, but A ≠ B, then we say A is a
proper subset of B, denoted by A ⊂ B.
If A ⊂ B, then
is true.
U
B
Venn Diagram A
Set Cardinality
Definition: If there are exactly n distinct elements in S
where n is a nonnegative integer, we say that S is finite.
Otherwise it is infinite.
Definition: The cardinality of a finite set A, denoted by
|A|, is the number of (distinct) elements of A.
Examples:
1. |ø| = 0
2. Let S be the letters of the English alphabet. Then |S| = 26
3. |{1,2,3}| = 3
4. |{ø}| = 1
5. The set of integers is infinite.
Power Sets
Definition: The set of all subsets of a set A, denoted
P(A), is called the power set of A.
Example: If A = {a,b} then
P(A) = {ø, {a},{b},{a,b}}
The ordered pairs (a, b) and (c, d) are equal if and only
if a = c and b = d.
René Descartes
(1596-1650)
Cartesian Product
Definition: The Cartesian Product of two sets A and B,
denoted by A × B is the set of ordered pairs (a,b) where
a ∈ A and b ∈ B.
Example:
A = {a,b} B = {1,2,3}
A × B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}
Example: The truth set of P(x) where the domain is the integers
and P(x) is “|x| = 1” is
the set {-1,1}.
Example: The truth set of Q(x) where the domain is the integers
and P(x) is “𝑥 2 = 2” is
the set ∅.
Example: The truth set of R(x) where the domain is the integers
and P(x) is “|x| = x” is
the set N.
Russell’s Paradox
Let S be the set of all sets which are not members of
themselves. A paradox results from trying to answer
the question “Is S a member of itself?”
Related Paradox:
Henry is a barber who shaves all people who do not
shave themselves. A paradox results from trying to
answer the question “Does Henry shave himself?”
Example:
U = {0,1,2,3,4,5,6,7,8,9,10} U
A = {1,2,3,4,5} B ={4,5,6,7,8} A B
What is :
Solution: {1,2,3,6,7,8}
Venn Diagram
Review Questions
Example: U = {0,1,2,3,4,5,6,7,8,9,10} A = {1,2,3,4,5}, B ={4,5,6,7,8}
1. A∪B
Solution: {1,2,3,4,5,6,7,8}
2. A∩B
Solution: {4,5}
3. Ā
Solution: {0,6,7,8,9,10}
4.
Solution: {0,1,2,3,9,10}
5. A – B
Solution: {1,2,3}
6. B – A
Solution: {6,7,8}
The Cardinality of the Union of Two
Sets
• Inclusion-Exclusion U
|A ∪ B| = |A| + | B| − |A ∩ B|
A B
Domination laws
Idempotent laws
Complementation law
Set Identities
Commutative laws
Associative laws
Distributive laws
Set Identities
De Morgan’s laws
Absorption laws
Complement laws
Proving Set Identities
Different ways to prove set identities:
1. Prove that each set (side of the identity) is a subset of
the other.
1) and
2)
Proof of Second De Morgan Law
These steps show that:
Proof of Second De Morgan Law
These steps show that:
Set-Builder Notation: Second De
Morgan Law
Membership Table
Example: Construct a membership table to show that the distributive law
holds.
Solution:
A B C
1 1 1 1 1 1 1 1
1 1 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 0 0 0 1 1 1 1
0 1 1 1 1 1 1 1
0 1 0 0 0 1 0 0
0 0 1 0 0 0 1 0
0 0 0 0 0 0 0 0
Computer Representation of Sets
There are various ways to represent sets using a computer.
Solution:
Bit string to represent the subset of all odd integers in 𝑈
is 10 1010 1010.
Bit string to represent the subset of all even integers in 𝑈
is 01 0101 0101.
Bit string to represent the subset of integers not
exceeding 5 in 𝑈 is 11 1110 0000.
Partitions of Sets
A partition or quotient set of a nonempty set 𝐴 is a
collection P of nonempty subsets of 𝐴 such that
1. Each element of 𝐴 belongs to one of the sets in P .
2. If 𝐴1 and 𝐴2 are distinct elements of P, then
𝐴1 ⋂𝐴2 = Φ.
Solution:
{𝐴1 , 𝐴2 } is not a partition since 𝐴1 ⋂𝐴2 ≠ Φ.