Set Theory
Set Theory
Computing
SET THEORY
NM FASMIE
Contents
• Introduction to Set
• Empty set, Unit set, Membership, Subset, Cardinality, Power set, Special sets
• Venn Diagram
• Union, Intersection, Disjoint sets, Cardinality of Union and Intersection,
Difference of sets, Cartesian product, Partition of a set
• Set Identities
• Set Equality
• Proving Set Equality
2
Introduction to Set
• A set is a collection of abstract objects.
• Typically a set is determined by its distinct elements (i.e. members) where the
order does not matter though the repetition is not interested.
• Eg:
4
Subset
• Definition:
• A set is a subset of a set , denoted by , iff every element of is also an element of .
Formally written as follow
• Note:
• : is a subset of Note:
• The null set (i.e. empty set - ) and
• : is a subset of , possibly equal to
set itself are called trivial subsets.
• : is not a subset of
• If but and , then is a proper
subset of .
5
Cardinality & Power set
• Cardinality – Definition:
• The cardinality of a set is the number of distinct elements of .
• Eg:
7
Example – 1
• Problem:
• Prove that the sets and satisfy .
• Solution:
• An arbitrary element of is of the form for some . An arbitrary
element of is of the form for some . Clearly, for the integer . Since an
arbitrary element of is an element of , we conclude .
8
Example – 2
• Problem:
• Let . Is ?
• Solution:
To show that , we must find a natural number such that
Since every element of has the form for some . To find out if there is such a , we simply
solve the equation for and see if the solution is an integer.
• Intersection
• The intersection of the sets and is the set of all
elements that are in both and .
• Disjoint sets
𝐴
• Sets and are disjoint iff (i.e. ). 𝐴∩ 𝐵=∅
10
Cardinality of Union and Intersection
𝐴𝐵 𝐴𝐵 𝐵 𝐵
11
Difference of sets
• Definition: The difference of the sets and ,
𝐴−𝐵𝐵
also called complement of with respect to
𝐵−𝐴
is the set containing elements that are in A
but not in .
Note:
Note:
13
Partition of a set
• Definition: A collection of nonempty sets is a partition of a set iff
14
Set Identities
(De Morgan’s Law)
De Morgan’s Law,
𝐴−𝐵𝐵
15
Set Identities
Identity And Form OR Form
Identity Law
Null (or Dominance) Law
Idempotent Law
Inverse Law
Commutative Law
Associative Law
Distributive Law
Absorption Law
DeMorgan’s Law
Double Negation Law
Alternative representation
for set difference
16
Set Equality
• Two sets are equal iff they contain exactly the same elements.
• i.e. iff and .
17
Proving Set Equality – Each others’ subset
Show that
when
Therefore, 18
Proving Set Equality – Each others’ subset
For any , and .
when and
when and
Therefore,
0 0 0 0 0
0 1 1 0 0
1 0 1 1 1
1 1 1 0 0
21