0% found this document useful (0 votes)
120 views36 pages

Set Theory

Set theory deals with operations between, relations among, and statements about sets. A set is a structure representing an unordered collection of zero or more distinct objects. Basic notations for sets include listing elements in curly braces or using set builder notation. Sets are inherently unordered and contain only distinct elements. The cardinality of a set measures how many elements it has. Power sets contain all subsets of a given set. Operations on sets include union, intersection, and Cartesian products.

Uploaded by

gpradeepraja2912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views36 pages

Set Theory

Set theory deals with operations between, relations among, and statements about sets. A set is a structure representing an unordered collection of zero or more distinct objects. Basic notations for sets include listing elements in curly braces or using set builder notation. Sets are inherently unordered and contain only distinct elements. The cardinality of a set measures how many elements it has. Power sets contain all subsets of a given set. Operations on sets include union, intersection, and Cartesian products.

Uploaded by

gpradeepraja2912
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 36

1

Set Theory
Rosen 6 Rosen 6
th th
ed., ed., ii2.1 2.1- -2.2 2.2
2
Introduction to Set Theory
A A set set is a structure, representing an is a structure, representing an
unordered unordered collection (group, plurality) of collection (group, plurality) of
zero or more zero or more distinct distinct (different) objects. (different) objects.
Set theory deals with operations between, Set theory deals with operations between,
relations among, and statements about sets. relations among, and statements about sets.
3
Basic notations for sets
For sets, well use variables For sets, well use variables SS, , T T, , U U, ,
We can denote a set We can denote a set SS in writing by listing all of in writing by listing all of
its elements in curly braces: its elements in curly braces:
{a, b, c} is the set of whatever 3 objects are denoted by {a, b, c} is the set of whatever 3 objects are denoted by
a, b, c. a, b, c.
Set Set builder notation builder notation: For any proposition : For any proposition PP( (xx) over ) over
any universe of discourse, { any universe of discourse, {xx| |PP( (xx)} is )} is the set of all the set of all
x such that P(x). x such that P(x).
e.g., { e.g., {xx | | xx is an integer where is an integer where xx>0 and >0 and xx<5 } <5 }
4
Basic properties of sets
Sets are inherently Sets are inherently unordered unordered::
No matter what objects a, b, and c denote, No matter what objects a, b, and c denote,
{a, b, c} = {a, c, b} = {b, a, c} = {a, b, c} = {a, c, b} = {b, a, c} =
{b, c, a} = {c, a, b} = {c, b, a}. {b, c, a} = {c, a, b} = {c, b, a}.
All elements are All elements are distinct distinct (unequal); (unequal);
multiple listings make no difference! multiple listings make no difference!
{a, b, c} = {a, a, b, a, b, c, c, c, c}. {a, b, c} = {a, a, b, a, b, c, c, c, c}.
This set contains at most 3 elements! This set contains at most 3 elements!
5
Definition of Set Equality
Two sets are declared to be equal Two sets are declared to be equal if and only if if and only if
they contain they contain exactly the same exactly the same elements. elements.
In particular, it does not matter In particular, it does not matter how the set is how the set is
defined or denoted. defined or denoted.
For example: The set {1, 2, 3, 4} = For example: The set {1, 2, 3, 4} =
{{xx | | xx is an integer where is an integer where xx>0 and >0 and xx<5 } = <5 } =
{{xx | | xx is a positive integer whose square is a positive integer whose square
is >0 and <25} is >0 and <25}
6
Infinite Sets
Conceptually, sets may be Conceptually, sets may be infinite infinite ( (i.e., i.e., not not
finite finite, without end, unending). , without end, unending).
Symbols for some special infinite sets: Symbols for some special infinite sets:
N N = {0, 1, 2, } The = {0, 1, 2, } The n natural numbers. atural numbers.
ZZ = {, = {, - -2, 2, - -1, 0, 1, 2, } The 1, 0, 1, 2, } The iintegers. ntegers.
R R = The = The rreal numbers, such as eal numbers, such as
374.1828471929498181917281943125 374.1828471929498181917281943125
Infinite sets come in different sizes! Infinite sets come in different sizes!
7
Venn Diagrams
8
Basic Set Relations: Member of
xxS S ( (xx is in is in SS) ) is the proposition that object is the proposition that object xx is is
an an lement lement or or member member of set of set SS..
e.g. e.g. 33N N, , a a{{x x | | xx is a letter of the alphabet} is a letter of the alphabet}
Can define Can define set equality set equality in terms of in terms of relation: relation:
SS,,T T: : SS==T T mm( (xx: : xxSS mmxxT T) )
Two sets are equal Two sets are equal iff iff they have all the same they have all the same
members. members.
xxS S ::|| ( (xxSS) ) xx is not in is not in SS
9
The Empty Set
(null, the empty set) is the unique set (null, the empty set) is the unique set
that contains no elements whatsoever. that contains no elements whatsoever.
= {} = { = {} = {x| x|False False}}
No matter the domain of discourse, No matter the domain of discourse,
we have the axiom we have the axiom
xx: : xx ..
10
Subset and Superset Relations
SST T ( (SS is a subset of is a subset of T T) means that every ) means that every
element of element of SS is also an element of is also an element of T T..
SST T x x ( (xxSS ppxxT T) )
SS, , SSS. S.
SS__T T ( (SS is a superset of is a superset of T T) means ) means T TSS..
Note Note S=T S=T SST T SS__T. T.
means means ( (SST T), ), i.e. i.e. xx( (xxSS xxT T) )
T S
/

11
Proper (Strict) Subsets & Supersets
SST T ( (SS is a proper subset of is a proper subset of T T) means that ) means that
SST T but but . . Similar for Similar for SST. T.
S T
/

S
T
Venn Diagram equivalent of ST
Example:
{1,2}
{1,2,3}
12
Sets Are Objects, Too!
The objects that are elements of a set may The objects that are elements of a set may
themselves themselves be sets. be sets.
E.g. E.g. let let SS={ ={x x | | x x {1,2,3}} {1,2,3}}
then then SS={ ={ , ,
{1}, {2}, {3}, {1}, {2}, {3},
{1,2}, {1,3}, {2,3}, {1,2}, {1,3}, {2,3},
{1,2,3}} {1,2,3}}
Note that 1 Note that 1 {{ {1} {1} {{ {{1}} !!!! {{1}} !!!!
13
Cardinality and Finiteness
| |SS| (read the | (read the cardinality cardinality of of SS) is a measure ) is a measure
of how many different elements of how many different elements SS has. has.
E.g. E.g., | , | |=0, |{1,2,3}| = 3, |{a,b}| = 2, |=0, |{1,2,3}| = 3, |{a,b}| = 2,
|{{1,2,3},{4,5}}| = ____ |{{1,2,3},{4,5}}| = ____
We say We say SS is is infinite infinite if it is not if it is not finite finite..
What are some infinite sets weve seen? What are some infinite sets weve seen?
14
The Power Set Operation
The The power set power set P( P(SS) of a set ) of a set SS is the set of all is the set of all
subsets of subsets of SS. P( . P(SS) = { ) = {x x | | xxSS}. }.
EE..g. g. P({a,b}) = { P({a,b}) = { , {a}, {b}, {a,b}}. , {a}, {b}, {a,b}}.
Sometimes P( Sometimes P(SS) is written ) is written 22
SS
..
Note that for finite Note that for finite SS, |P( , |P(SS)| = 2 )| = 2
| |SS| |
..
It turns out that |P( It turns out that |P(N N)| > | )| > |N N|. |.
There are different sizes of infinite sets There are different sizes of infinite sets! !
15
Ordered n-tuples
For For nnN N, an , an ordered n ordered n- -tuple tuple or a or a sequence sequence
of of length n length n is written ( is written (aa
11
, , aa
22
, , , , aa
nn
). The ). The
first first element is element is aa
11
, , etc. etc.
These are like sets, except that duplicates These are like sets, except that duplicates
matter, and the order makes a difference. matter, and the order makes a difference.
Note (1, 2) Note (1, 2) {{ (2, 1) (2, 1) {{ (2, 1, 1). (2, 1, 1).
Empty sequence, singlets, pairs, triples, Empty sequence, singlets, pairs, triples,
quadruples, quin quadruples, quintuples tuples, , , , nn- -tuples. tuples.
16
Cartesian Products of Sets
For sets For sets AA, , BB, their , their Cartesian product Cartesian product
AA--B B ::|| {( {(aa, , bb) | ) | aaAA bbB B }. }.
E.g. E.g. {a,b} {a,b}--{1,2} = {(a,1),(a,2),(b,1),(b,2)} {1,2} = {(a,1),(a,2),(b,1),(b,2)}
Note that for finite Note that for finite AA, , BB, | , |AA--BB|=| |=|AA|| ||BB|. |.
Note that the Cartesian product is Note that the Cartesian product is not not
commutative: commutative: AB AB: : AA--B B ==BB--AA..
Extends to Extends to AA
11
-- AA
22
-- -- AA
nn
... ...
17
The Union Operator
For sets For sets AA, , BB, their , their union union AA BB is the set is the set
containing all elements that are either in containing all elements that are either in AA, ,
or or ( (v v) in ) in BB (or, of course, in both). (or, of course, in both).
Formally, Formally, AA,,BB: : AA BB = { = {x x | | xxAA v v xxBB}. }.
Note that Note that AA B B contains all the elements of contains all the elements of
AA and and it contains all the elements of it contains all the elements of BB::
AA, , BB: ( : (AA B B __ AA) ) ( (AA B B __ BB) )
18
{a,b,c} {a,b,c} {2,3} = {a,b,c,2,3} {2,3} = {a,b,c,2,3}
{2,3,5} {2,3,5} {3,5,7} {3,5,7} = { = {2,3,5 2,3,5,,3,5,7 3,5,7} = } ={2,3,5,7} {2,3,5,7}
Union Examples
19
The Intersection Operator
For sets For sets AA, , BB, their , their intersection intersection AA BB is the is the
set containing all elements that are set containing all elements that are
simultaneously in simultaneously in A A and and ( ( ) in ) in BB..
Formally, Formally, AA,,BB: : AA BB||{{x x | | xxAA xxBB}. }.
Note that Note that AA B B is a subset of is a subset of AA and and it is a it is a
subset of subset of BB::
AA, , BB: ( : (AA B B AA) ) ( (AA B B BB) )
20
{a,b,c} {a,b,c} {2,3} = ___ {2,3} = ___
{2,4,6} {2,4,6} {3,4,5} {3,4,5} = ______ = ______
Intersection Examples

{4}
21
Disjointedness
Two sets Two sets AA, , BB are called are called
disjoint disjoint ( (i.e. i.e., unjoined) , unjoined)
iff their intersection is iff their intersection is
empty. ( empty. (AA BB== ) )
Example: the set of even Example: the set of even
integers is disjoint with integers is disjoint with
the set of odd integers. the set of odd integers.
Help, Ive
been
disjointed!
22
Inclusion-Exclusion Principle
How many elements are in How many elements are in AA BB??
| |AA BB| | = |A| = |A| ++ |B| |B| | |AA BB| |
Example: Example:
{2,3,5} {2,3,5} {3,5,7} {3,5,7} = { = {2,3,5 2,3,5,,3,5,7 3,5,7} = } ={2,3,5,7} {2,3,5,7}
23
Set Difference
For sets For sets AA, , BB, the , the difference difference of A and B of A and B, ,
written written AABB, is the set of all elements that , is the set of all elements that
are in are in AA but not but not BB..
A A B B ::|| __x x ` ` xxA A xxBBaa
!! __xx ` ` xxAA ppxxBB aa
Also called: Also called:
The The complement complement of of BB with respect to with respect to AA..
24
Set Difference Examples
{1,2,3,4,5,6} {1,2,3,4,5,6} {2,3,5,7,9,11} = {2,3,5,7,9,11} =
___________ ___________
Z Z N N !! { , { , - -1, 0, 1, 2, } 1, 0, 1, 2, } {0, 1, } {0, 1, }
= { = {x x | | xx is an integer but not a nat. #} is an integer but not a nat. #}
= { = {xx | | xx is a negative integer} is a negative integer}
= { , = { , - -3, 3, - -2, 2, - -1} 1}
{1,4,6}
25
Set Difference - Venn Diagram
AA- -BB is whats left after is whats left after BB
takes a bite out of takes a bite out of AA
Set A
Set B
Set
AB
Chomp!
26
Set Complements
The The universe of discourse universe of discourse can itself be can itself be
considered a set, call it considered a set, call it U U..
The The complement complement of of AA, written , is the , written , is the
complement of complement of AA w.r.t. w.r.t. U U, , i.e. i.e.,, it is it is U UA. A.
E.g., E.g., If If U U==N N, ,
A
,...} 7 , 6 , 4 , 2 , 1 , 0 { } 5 , 3 { !
27
More on Set Complements
An equivalent definition, when An equivalent definition, when U U is clear: is clear:
} | { A x x A !
A
U
A
28
Set Identities
Identity: Identity: AA ==AA AA U U==AA
Domination: Domination: AA U=U A U=U A ==
Idempotent: Idempotent: AA AA = = A = A = AA AA
Double complement: Double complement:
Commutative: Commutative: AA B=B B=B A A A A B=B B=B AA
Associative: Associative: AA ( (BB CC)=( )=(AA BB) ) CC
AA ( (BB CC)=( )=(AA BB) ) CC
A A ! ) (
29
DeMorgans Law for Sets
Exactly analogous to (and derivable from) Exactly analogous to (and derivable from)
DeMorgans Law for propositions. DeMorgans Law for propositions.
B A B A
B A B A
!
!
30
Proving Set Identities
To prove statements about sets, of the form To prove statements about sets, of the form
EE
11
= = EE
22
(where (where EEs are set expressions), here s are set expressions), here
are three useful techniques: are three useful techniques:
Prove Prove EE
11
EE
22
and and EE
22
EE
11
separately. separately.
Use logical equivalences. Use logical equivalences.
Use a Use a membership table membership table..
31
Method 1: Mutual subsets
Example: Show Example: Show AA ( (BB CC)=( )=(AA BB) ) ( (AA CC). ).
Show Show AA ( (BB CC) )( (AA BB) ) ( (AA CC). ).
Assume Assume xxAA ( (BB CC), & show ), & show xx( (AA BB) ) ( (AA CC). ).
We know that We know that xxAA, and either , and either xxBB or or xxC. C.
Case 1: Case 1: xxBB. Then . Then xxAA BB, so , so xx( (AA BB) ) ( (AA CC). ).
Case 2: Case 2: xxC. C. Then Then xxAA C C , so , so xx( (AA BB) ) ( (AA CC). ).
Therefore, Therefore, xx( (AA BB) ) ( (AA CC). ).
Therefore, Therefore, AA ( (BB CC) )( (AA BB) ) ( (AA CC). ).
Show ( Show (AA BB) ) ( (AA CC) ) AA ( (BB CC). ).
32
Method 3: Membership Tables
Just like truth tables for propositional logic. Just like truth tables for propositional logic.
Columns for different set expressions. Columns for different set expressions.
Rows for all combinations of memberships Rows for all combinations of memberships
in constituent sets. in constituent sets.
Use 1 to indicate membership in the Use 1 to indicate membership in the
derived set, 0 for non derived set, 0 for non- -membership. membership.
Prove equivalence with identical columns. Prove equivalence with identical columns.
33
Membership Table Example
Prove ( Prove (AA BB) )B = A B = ABB..
A
A
B
B
A
A

B
B
(
(
A
A

B
B
)
)

B
B
A
A

B
B
0 0 0 0 0
0 1 1 0 0
1 0 1 1 1
1 1 1 0 0
34
Membership Table Exercise
Prove ( Prove (AA BB) )CC = ( = (AACC) ) ( (BBCC). ).
A B C
A A B B ( (A A B B) ) C C A A C C B B C C ( (A A C C) ) ( (B B C C) )
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
35
Generalized Union
Binary union operator: Binary union operator: AA BB
nn- -ary union: ary union:
AA AA
22
AA
nn
::|| (((( ((((AA
11
AA
22
) ) ) ) AA
nn
) )
(grouping & order is irrelevant) (grouping & order is irrelevant)
Big U notation: Big U notation:
Or for infinite sets of sets: Or for infinite sets of sets:
7
n
i
i
A
1 !
7
X A
A

36
Generalized Intersection
Binary intersection operator: Binary intersection operator: AA BB
nn- -ary intersection: ary intersection:
AA AA
22
AA
nn
||(((( ((((AA
11
AA
22
) ) ) ) AA
nn
) )
(grouping & order is irrelevant) (grouping & order is irrelevant)
Big Arch notation: Big Arch notation:
Or for infinite sets of sets: Or for infinite sets of sets:
+
n
i
i
A
1 !
+
X A
A

You might also like