SlideShare a Scribd company logo
1
Module 1:Set Theory
Prof. Shiwani Gupta
History and Applications
• The editice of modern mathematics rests on the
concept of sets.
• Georg Cantor got his pHd in number theory.
• Important language and tool for reasoning.
• General: Reasoning and programming
• Real life: cellular phone, traffic lights, search box in
eBay, stock market, to a satellite
• Computer Science: Halting problem, Turing Machine
2
3
Introduction to Set Theory
• A set is a structure, representing a
welldefined unordered collection (group,
plurality) of zero or more distinct (different)
objects called elements or member of a set.
• Set theory deals with operations on,
relations among, and statements about sets.
4
Basic notations for sets
For sets, we’ll use variables S, T, U, …
• Roster or Tabular Form orListing Method: We can
denote a set S in writing by listing all of its elements in curly
braces:
– {a, b, c} is the set of whatever 3 objects are denoted by a, b,
c.
• Rule method or Set builder notation: For any
proposition P(x) over any universe of discourse, {x|P(x)} is the
set of all x such that P(x).
e.g., {x | x is an integer where x>0 and x<5 }
5
Basic properties of sets
• Sets are inherently unordered:
– No matter what objects a, b, and c denote,
{a, b, c} = {a, c, b} = {b, a, c} =
{b, c, a} = {c, a, b} = {c, b, a}.
• All elements are distinct (unequal);
multiple listings make no difference!
– {a, b, c} = {a, a, b, a, b, c, c, c, c}.
– This set contains at most 3 elements!
6
Definition of Set Equality
• Two sets are declared to be equal if and only if
they contain exactly the same elements.
• In particular, it does not matter how the set is
defined or denoted.
• For example: The set {1, 2, 3, 4} =
{x | x is an integer where x>0 and x<5 } =
{x | x is a positive integer whose square
is >0 and <25}
7
Infinite Sets
• Conceptually, sets may be infinite (i.e., not
finite, without end, unending).
• Symbols for some special infinite sets:
N = {0, 1, 2, …} The natural numbers.
Z = {…, -2, -1, 0, 1, 2, …} The integers.
R = The “real” numbers, such as
374.1828471929498181917281943125…
• Infinite sets come in different sizes!
8
Cardinality and Finiteness
• |S| (read “the cardinality of S”) is a measure of how many
different elements S has.
• E.g., ||=0, |{1,2,3}| = 3, |{a,b}| = 2,
|{{1,2,3},{4,5}}| = ____
• We say S is infinite if it is not finite.
• What are some infinite sets we’ve seen?
e.g. if S = {2, 3, 5, 7, 11, 13, 17, 19}, then |S|=8.
if S={CSC1130, CSC2110, ERG2020, MAT2510},then |S|=4.
if S = {{1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}}, then |S|=6.
Countably infinite and
Uncountably Infinite Sets
• Finite sets are countable eg. Z.
• Uncountable sets are infinite as R.
• N, Z, R are infinite sets.
• |N| is denoted as 0.
• Any set which can be put into 1-1 correspondence
with N,Z is also countably infinite or denumerable eg.
AN, set of even Integers, set of –ve Integers, set of
prime nos.
• Thus every infinite set has countable infinite subset.
9
10
Venn Diagrams
11
Basic Set Relations: Member of
• xS (“x is in S”) is the proposition that object x is
an element or member of set S.
– e.g. 3N, ‘a’{x | x is a letter of the alphabet}
• Can define set equality in terms of  relation:
S,T: S=T  (x: xS  xT)
“Two sets are equal iff they have all the same
members.”
• xS : (xS) “x is not in S”
12
The Empty, Universal, Singleton
Set
•  (“null”, “the empty set”, “void set”) is the unique set
that contains no elements whatsoever.
•  = {} = {x|False}
• No matter the domain of discourse, we have the axiom
x: x.
• In any application of theory of sets, the members of all sets
under investigation usually belong to some fixed large set
called Universal Set or Universe of Discourse.
• A set having only one element is Singleton set.
13
Subset and Superset Relations
• If every element in set S is element in set T, then S is called
subset of T.
• ST (“S is a subset of T”)
• We also say that S is contained in B or B contains A
• ST (“S is a superset of T”) means TS.
• ST  x (xS → xT)
• S, SS.
• Note S=T  ST ST.
• means (ST), i.e. x(xS  xT)
• Eg. S={1,2,3}, B=(1,2,3,4,5}
TS /
A B
14
Sets and Subsets
set equality C D C D D C=    ( ) ( )
subsets A B x x A x B     [ ]
][
)]()([
][
BxAxx
BxAxx
BxAxxBA



Fact: If , then |A| <= |B|.
15
Properties of Subsets
• If A={4, 8, 12, 16} and B={2, 4, 6, 8, 10, 12, 14, 16},
then but
• because every element in A is an element of A.
• for any A because the empty set has no elements.
• If A is the set of prime numbers and
B is the set of odd numbers, then
16
Proper (Strict) Subsets & Supersets
• ST (“S is a proper subset of T”) means that ST but
. Similar for ST.
ST /
S
T
Venn
Diagram
equivalent
of ST
Example:
{1,2}  {1,2,3}
Fact: If A = B, then |A| = |B|.
Fact: If , then |A| < |B|.
17
Sets and Subsets (common
notations)
(a) Z=the set of integers={0,1,-1,2,-1,3,-3,...}
(b) N=the set of nonnegative integers or natural numbers
(c) Z+=the set of positive integers
(d) Q=the set of rational numbers={a/b| a,b is integer, b not zero}
(e) Q+=the set of positive rational numbers
(f) Q*=the set of nonzero rational numbers
(g) R=the set of real numbers
(h) R+=the set of positive real numbers
(i) R*=the set of nonzero real numbers
(j) C=the set of complex numbers
18
Examples of sets
The set of all polynomials with degree at most three:
{1, x, x2, x3, 2x+3x2,…}.
The set of all n-bit strings:
{000…0, 000…1, …, 111…1}
The set of all triangles without an obtuse angle:
{ , ,… }
The set of all graphs with four nodes:
{ , , , ,…}
19
The Power Set Operation
• The power set P(S) of a set S is the set of all
subsets of S. P(S) = {x | xS}.
• E.g. P({a,b}) = {, {a}, {b}, {a,b}}.
• Sometimes P(S) is written 2S.
Note that for finite S, |P(S)| = 2|S|.
• It turns out that |P(N)| > |N|.
There are different sizes of infinite sets!
20
Sets Are Objects, Too!
• The objects that are elements of a set may
themselves be sets.
• E.g. let S={x | x  {1,2,3}}
then P(S)={,
{1}, {2}, {3},
{1,2}, {1,3}, {2,3},
{1,2,3}}
• Note that 1  {1}  {{1}} !!!!
21
Ordered n-tuples
• For nN, an ordered n-tuple or a sequence
of length n is written (a1, a2, …, an). The
first element is a1, etc.
• These are like sets, except that duplicates
matter, and the order makes a difference.
• Note (1, 2)  (2, 1)  (2, 1, 1).
• Empty sequence, singlets, pairs, triples,
quadruples, quintuples, …, n-tuples.
22
The Union Operator
• For sets A, B, their union AB is the set
containing all elements that are either in A,
or (“”) in B (or, of course, in both).
• Formally, A,B: AB  {x | xA  xB}.
• Note that AB contains all the elements of
A and it contains all the elements of B:
A, B: (AB  A)  (AB  B)
23
• {a,b,c}{2,3} = {a,b,c,2,3}
• {2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7}
Union Examples
24
The Intersection Operator
• For sets A, B, their intersection AB is the
set containing all elements that are
simultaneously in A and (“”) in B.
• Formally, A,B: AB{x | xA  xB}.
• Note that AB is a subset of A and it is a
subset of B:
A, B: (AB  A)  (AB  B)
25
• {a,b,c}{2,3} = ___
• {2,4,6}{3,4,5} = ______
Intersection Examples

{4}
26
Disjointedness
• Two sets A, B are called
disjoint (i.e., unjoined)
iff their intersection is
empty. (AB=)
• Example: the set of even
integers is disjoint with
the set of odd integers.
Help, I’ve
been
disjointed!
27
Set Difference
• For sets A, B, the difference of A and B,
written A−B, is the set of all elements that
are in A but not B.
• A − B : x  xA  xB
= x  ( xA → xB ) 
• Also called:
The complement of B with respect to A.
28
Set Difference Examples
• {1,2,3,4,5,6} − {2,3,5,7,9,11} =
___________
• Z − N = {… , -1, 0, 1, 2, … } − {0, 1, … }
= {x | x is an integer but not a nat. #}
= {x | x is a negative integer}
= {… , -3, -2, -1}
{1,4,6}
29
Set Difference - Venn Diagram
• A-B is what’s left after B
“takes a bite out of A”
Set A Set B
Set
A−B
Chomp!
30
Set Complements
• The universe of discourse can itself be
considered a set, call it U.
• The complement of A, written , is the
complement of A w.r.t. U, i.e., it is U−A.
• E.g., If U=N,
A
,...}7,6,4,2,1,0{}5,3{ =
31
More on Set Complements
• An equivalent definition, when U is clear:
}|{ AxxA =
A
U
A
32
Ring Sum (Symmetric
Difference)
• Let A and B be two non empty sets then
ring sum of A and B is set of all elements
which are either in A or in B but not in
both.
• Thus A⊕B={x | x ∈ A∪B but ∉ A∩B}
= {x|(x∈A and x∉B)or (x∈B and x ∉A)}
33
Cartesian Products of Sets
• For sets A, B, their Cartesian product
AB : {(a, b) | aA  bB }.
• E.g. {a,b}{1,2} = {(a,1),(a,2),(b,1),(b,2)}
• Note that for finite A, B, |AB|=|A||B|.
• Note that the Cartesian product is not
commutative: AB: AB =BA.
• Extends to A1  A2  …  An...
34
Cartesian Product
• Let A be the set of letters, i.e. {a,b,c,…,x,y,z}.
• Let B be the set of digits, i.e. {0,1,…,9}.
AxA is just the set of strings with two letters.
BxB is just the set of strings with two digits.
AxB is the set of strings where the first character is a letter
and the second character is a digit.
Definition: Given two sets A and B, the Cartesian product A
x B is the set of all ordered pairs (a,b), where a is in A and b
is in B. (1,2) ≠ (2,1)
35
Laws of set theory
• Identity: A=A AU=A
• Domination: AU=U A=
• Idempotent: AA = A = AA
• Involution:
• Commutative: AB=BA AB=BA
• Associative: A(BC)=(AB)C
A(BC)=(AB)C
AA =)(
36
Laws of set theory
• Distributive: A∩(BC)=(A∩B)(A∩C)
A (BC)=(AB)(AC)
• Properties of complement:
AAc =U AAc = 
c =U Uc= 
37
DeMorgan’s Law for Sets
• Exactly analogous to (and derivable from) DeMorgan’s
Law for propositions.
BABA
BABA
=
=
38
Set Operations and the Laws of
Set Theory
s dual of s (sd)


U
U
 
 
Theorem (The Principle of Duality)
39
Partition of sets
A collection of nonempty sets {A1, A2, …, An} is a partition
of a set A if and only if
A1, A2, …, An are mutually disjoint (or pairwise disjoint).
e.g. Let A be the set of integers.
A1 = {x A | x = 3k+1 for some integer k}
A2 = {x A | x = 3k+2 for some integer k}
A3 = {x A | x = 3k for some integer k}
Then {A1,A2,A3} is a partition of A
Partition of sets
e.g. Let A be the set of integers divisible by 6.
A1 be the set of integers divisible by 2.
A2 be the set of integers divisible by 3.
Then {A1,A2} is not a partition of A, because A1 and A2 are not disjoint,
and also A A1 A2 (so both conditions are not satisfied).
e.g. Let A be the set of integers.
Let A1 be the set of negative integers.
Let A2 be the set of positive integers.
Then {A1,A2} is not a partition of A, because A ≠A1 A2
as 0 is contained in A but not contained in A1 A2
41
(Addition Principle / Sum Rule)
If sets A and B are disjoint, then
|A  B| = |A| + |B|
A B
What if A and B are not disjoint?
42
Inclusion-Exclusion Principle
• How many elements are in AB?
|AB| = |A| + |B| − |AB|
• Example:
{2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7}
43
Inclusion Exclusion (2 sets)
For two arbitrary sets A and B
|||||||| BABABA −+=
A
B
44
Inclusion Exclusion (3sets)
A B
C
|A  B  C| = |A| + |B| + |C| – |A  B| – |A  C| – |B  C|
+ |A  B  C|
45
Inclusion Exclusion (4 sets)
A B
C
|A  B  C  D| = |A| + |B| + |C| + |D|
– |A  B| – |A  C| – |A  D| – |B  C| – |B  D| – |C  D|
+ |A  B  C| + |A  B  D| + |A  C  D| + |B  C  D|
– |A  B  C  D |
D
46
Inclusion Exclusion (n sets)
What is the inclusion-exclusion formula for the union of n
sets?
47
Counting and Venn Diagrams
• In a class of 50 college freshmen, 30 are studying BASIC,
25 studying PASCAL, and 10 are studying both. How
many freshmen are studying either computer language?
| | | | | | | |A B A B A B = + − 
A B
10 1520

More Related Content

What's hot

Independence, basis and dimension
Independence, basis and dimensionIndependence, basis and dimension
Independence, basis and dimension
ATUL KUMAR YADAV
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
SURBHI SAROHA
 
Rank nullity theorem
Rank nullity theoremRank nullity theorem
Rank nullity theorem
Roqui Gonzaga
 
Infinite sequence and series
Infinite sequence and seriesInfinite sequence and series
Infinite sequence and series
Bhavik A Shah
 
Group abstract algebra
Group  abstract algebraGroup  abstract algebra
Group abstract algebra
NaliniSPatil
 
Set theory
Set theorySet theory
Set theory
manikanta361
 
Set Theory
Set TheorySet Theory
Set Theoryitutor
 
Set theory
Set theory Set theory
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrixitutor
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
Rachana Pathak
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
Anjali Devi J S
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
BindhuBhargaviTalasi
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
Naralaswapna
 
Counting techniques
Counting techniquesCounting techniques
Counting techniques
Chie Pegollo
 
Properties of relations
Properties of relationsProperties of relations
Properties of relations
Inamul Hossain Imran
 
Extension principle
Extension principleExtension principle
Extension principleSavo Delić
 
CMSC 56 | Lecture 15: Closures of Relations
CMSC 56 | Lecture 15: Closures of RelationsCMSC 56 | Lecture 15: Closures of Relations
CMSC 56 | Lecture 15: Closures of Relations
allyn joy calcaben
 
Rank of a matrix
Rank of a matrixRank of a matrix
Rank of a matrix
muthukrishnaveni anand
 
1. set theory
1. set theory1. set theory
1. set theory
caymulb
 

What's hot (20)

Independence, basis and dimension
Independence, basis and dimensionIndependence, basis and dimension
Independence, basis and dimension
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
 
Rank nullity theorem
Rank nullity theoremRank nullity theorem
Rank nullity theorem
 
Infinite sequence and series
Infinite sequence and seriesInfinite sequence and series
Infinite sequence and series
 
Group abstract algebra
Group  abstract algebraGroup  abstract algebra
Group abstract algebra
 
Set theory
Set theorySet theory
Set theory
 
Set Theory
Set TheorySet Theory
Set Theory
 
Set theory
Set theory Set theory
Set theory
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrix
 
Set Theory Presentation
Set Theory PresentationSet Theory Presentation
Set Theory Presentation
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
 
Counting techniques
Counting techniquesCounting techniques
Counting techniques
 
Properties of relations
Properties of relationsProperties of relations
Properties of relations
 
Extension principle
Extension principleExtension principle
Extension principle
 
CMSC 56 | Lecture 15: Closures of Relations
CMSC 56 | Lecture 15: Closures of RelationsCMSC 56 | Lecture 15: Closures of Relations
CMSC 56 | Lecture 15: Closures of Relations
 
Rank of a matrix
Rank of a matrixRank of a matrix
Rank of a matrix
 
1. set theory
1. set theory1. set theory
1. set theory
 

Similar to Set theory

SetTheory.ppt
SetTheory.pptSetTheory.ppt
SetTheory.ppt
bryanchristianbrione1
 
SetTheory.ppt
SetTheory.pptSetTheory.ppt
SetTheory.ppt
sanjeevnandwani
 
Introduction to set theory with application
Introduction to set theory with applicationIntroduction to set theory with application
Introduction to set theory with application
Okunlola Oluyemi Adewole
 
A set is a structure, representing an unordered collection (group, plurality)...
A set is a structure, representing an unordered collection (group, plurality)...A set is a structure, representing an unordered collection (group, plurality)...
A set is a structure, representing an unordered collection (group, plurality)...
OluyemiOkunlola
 
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptxMoazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
KhalidSyfullah6
 
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Amr Rashed
 
set 1.pdf
set 1.pdfset 1.pdf
set 1.pdf
ssuser842a68
 
Set theory
Set theorySet theory
Set theory
Gaditek
 
Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1
Amr Rashed
 
7-Sets-1.ppt
7-Sets-1.ppt7-Sets-1.ppt
7-Sets-1.ppt
jaffarbikat
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
Usama ahmad
 
Blackbox task 2
Blackbox task 2Blackbox task 2
Blackbox task 2
blackbox90s
 
Class7 converted
Class7 convertedClass7 converted
Class7 converted
shouryasree
 
Set
SetSet
Set
H K
 
set.pdf
set.pdfset.pdf
set.pdf
SherazSyed3
 
Introduction to Sets
Introduction to SetsIntroduction to Sets
Introduction to Sets
Ashita Agrawal
 
sets.pptx
sets.pptxsets.pptx
sets.pptx
Amal Mohamed
 
Sets automata
Sets automataSets automata
Sets automata
ajeela mushtaq
 
maths
mathsmaths
Set theory
Set theorySet theory
Set theory
Robert Geofroy
 

Similar to Set theory (20)

SetTheory.ppt
SetTheory.pptSetTheory.ppt
SetTheory.ppt
 
SetTheory.ppt
SetTheory.pptSetTheory.ppt
SetTheory.ppt
 
Introduction to set theory with application
Introduction to set theory with applicationIntroduction to set theory with application
Introduction to set theory with application
 
A set is a structure, representing an unordered collection (group, plurality)...
A set is a structure, representing an unordered collection (group, plurality)...A set is a structure, representing an unordered collection (group, plurality)...
A set is a structure, representing an unordered collection (group, plurality)...
 
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptxMoazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
 
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
 
set 1.pdf
set 1.pdfset 1.pdf
set 1.pdf
 
Set theory
Set theorySet theory
Set theory
 
Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1
 
7-Sets-1.ppt
7-Sets-1.ppt7-Sets-1.ppt
7-Sets-1.ppt
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
 
Blackbox task 2
Blackbox task 2Blackbox task 2
Blackbox task 2
 
Class7 converted
Class7 convertedClass7 converted
Class7 converted
 
Set
SetSet
Set
 
set.pdf
set.pdfset.pdf
set.pdf
 
Introduction to Sets
Introduction to SetsIntroduction to Sets
Introduction to Sets
 
sets.pptx
sets.pptxsets.pptx
sets.pptx
 
Sets automata
Sets automataSets automata
Sets automata
 
maths
mathsmaths
maths
 
Set theory
Set theorySet theory
Set theory
 

More from Shiwani Gupta

ML MODULE 6.pdf
ML MODULE 6.pdfML MODULE 6.pdf
ML MODULE 6.pdf
Shiwani Gupta
 
ML MODULE 5.pdf
ML MODULE 5.pdfML MODULE 5.pdf
ML MODULE 5.pdf
Shiwani Gupta
 
ML MODULE 4.pdf
ML MODULE 4.pdfML MODULE 4.pdf
ML MODULE 4.pdf
Shiwani Gupta
 
module6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdfmodule6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdf
Shiwani Gupta
 
module5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdfmodule5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdf
Shiwani Gupta
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
Shiwani Gupta
 
module3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdfmodule3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdf
Shiwani Gupta
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdfmodule2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
Shiwani Gupta
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
Shiwani Gupta
 
ML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdfML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdf
Shiwani Gupta
 
ML MODULE 2.pdf
ML MODULE 2.pdfML MODULE 2.pdf
ML MODULE 2.pdf
Shiwani Gupta
 
ML Module 3.pdf
ML Module 3.pdfML Module 3.pdf
ML Module 3.pdf
Shiwani Gupta
 
Problem formulation
Problem formulationProblem formulation
Problem formulation
Shiwani Gupta
 
Simplex method
Simplex methodSimplex method
Simplex method
Shiwani Gupta
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
Shiwani Gupta
 
Relations
RelationsRelations
Relations
Shiwani Gupta
 
Logic
LogicLogic
Uncertain knowledge and reasoning
Uncertain knowledge and reasoningUncertain knowledge and reasoning
Uncertain knowledge and reasoning
Shiwani Gupta
 
Introduction to ai
Introduction to aiIntroduction to ai
Introduction to ai
Shiwani Gupta
 
Planning Agent
Planning AgentPlanning Agent
Planning Agent
Shiwani Gupta
 

More from Shiwani Gupta (20)

ML MODULE 6.pdf
ML MODULE 6.pdfML MODULE 6.pdf
ML MODULE 6.pdf
 
ML MODULE 5.pdf
ML MODULE 5.pdfML MODULE 5.pdf
ML MODULE 5.pdf
 
ML MODULE 4.pdf
ML MODULE 4.pdfML MODULE 4.pdf
ML MODULE 4.pdf
 
module6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdfmodule6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdf
 
module5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdfmodule5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdf
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
 
module3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdfmodule3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdf
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdfmodule2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
 
ML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdfML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdf
 
ML MODULE 2.pdf
ML MODULE 2.pdfML MODULE 2.pdf
ML MODULE 2.pdf
 
ML Module 3.pdf
ML Module 3.pdfML Module 3.pdf
ML Module 3.pdf
 
Problem formulation
Problem formulationProblem formulation
Problem formulation
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
 
Relations
RelationsRelations
Relations
 
Logic
LogicLogic
Logic
 
Uncertain knowledge and reasoning
Uncertain knowledge and reasoningUncertain knowledge and reasoning
Uncertain knowledge and reasoning
 
Introduction to ai
Introduction to aiIntroduction to ai
Introduction to ai
 
Planning Agent
Planning AgentPlanning Agent
Planning Agent
 

Recently uploaded

一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 

Recently uploaded (20)

一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 

Set theory

  • 2. History and Applications • The editice of modern mathematics rests on the concept of sets. • Georg Cantor got his pHd in number theory. • Important language and tool for reasoning. • General: Reasoning and programming • Real life: cellular phone, traffic lights, search box in eBay, stock market, to a satellite • Computer Science: Halting problem, Turing Machine 2
  • 3. 3 Introduction to Set Theory • A set is a structure, representing a welldefined unordered collection (group, plurality) of zero or more distinct (different) objects called elements or member of a set. • Set theory deals with operations on, relations among, and statements about sets.
  • 4. 4 Basic notations for sets For sets, we’ll use variables S, T, U, … • Roster or Tabular Form orListing Method: We can denote a set S in writing by listing all of its elements in curly braces: – {a, b, c} is the set of whatever 3 objects are denoted by a, b, c. • Rule method or Set builder notation: For any proposition P(x) over any universe of discourse, {x|P(x)} is the set of all x such that P(x). e.g., {x | x is an integer where x>0 and x<5 }
  • 5. 5 Basic properties of sets • Sets are inherently unordered: – No matter what objects a, b, and c denote, {a, b, c} = {a, c, b} = {b, a, c} = {b, c, a} = {c, a, b} = {c, b, a}. • All elements are distinct (unequal); multiple listings make no difference! – {a, b, c} = {a, a, b, a, b, c, c, c, c}. – This set contains at most 3 elements!
  • 6. 6 Definition of Set Equality • Two sets are declared to be equal if and only if they contain exactly the same elements. • In particular, it does not matter how the set is defined or denoted. • For example: The set {1, 2, 3, 4} = {x | x is an integer where x>0 and x<5 } = {x | x is a positive integer whose square is >0 and <25}
  • 7. 7 Infinite Sets • Conceptually, sets may be infinite (i.e., not finite, without end, unending). • Symbols for some special infinite sets: N = {0, 1, 2, …} The natural numbers. Z = {…, -2, -1, 0, 1, 2, …} The integers. R = The “real” numbers, such as 374.1828471929498181917281943125… • Infinite sets come in different sizes!
  • 8. 8 Cardinality and Finiteness • |S| (read “the cardinality of S”) is a measure of how many different elements S has. • E.g., ||=0, |{1,2,3}| = 3, |{a,b}| = 2, |{{1,2,3},{4,5}}| = ____ • We say S is infinite if it is not finite. • What are some infinite sets we’ve seen? e.g. if S = {2, 3, 5, 7, 11, 13, 17, 19}, then |S|=8. if S={CSC1130, CSC2110, ERG2020, MAT2510},then |S|=4. if S = {{1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}}, then |S|=6.
  • 9. Countably infinite and Uncountably Infinite Sets • Finite sets are countable eg. Z. • Uncountable sets are infinite as R. • N, Z, R are infinite sets. • |N| is denoted as 0. • Any set which can be put into 1-1 correspondence with N,Z is also countably infinite or denumerable eg. AN, set of even Integers, set of –ve Integers, set of prime nos. • Thus every infinite set has countable infinite subset. 9
  • 11. 11 Basic Set Relations: Member of • xS (“x is in S”) is the proposition that object x is an element or member of set S. – e.g. 3N, ‘a’{x | x is a letter of the alphabet} • Can define set equality in terms of  relation: S,T: S=T  (x: xS  xT) “Two sets are equal iff they have all the same members.” • xS : (xS) “x is not in S”
  • 12. 12 The Empty, Universal, Singleton Set •  (“null”, “the empty set”, “void set”) is the unique set that contains no elements whatsoever. •  = {} = {x|False} • No matter the domain of discourse, we have the axiom x: x. • In any application of theory of sets, the members of all sets under investigation usually belong to some fixed large set called Universal Set or Universe of Discourse. • A set having only one element is Singleton set.
  • 13. 13 Subset and Superset Relations • If every element in set S is element in set T, then S is called subset of T. • ST (“S is a subset of T”) • We also say that S is contained in B or B contains A • ST (“S is a superset of T”) means TS. • ST  x (xS → xT) • S, SS. • Note S=T  ST ST. • means (ST), i.e. x(xS  xT) • Eg. S={1,2,3}, B=(1,2,3,4,5} TS / A B
  • 14. 14 Sets and Subsets set equality C D C D D C=    ( ) ( ) subsets A B x x A x B     [ ] ][ )]()([ ][ BxAxx BxAxx BxAxxBA    Fact: If , then |A| <= |B|.
  • 15. 15 Properties of Subsets • If A={4, 8, 12, 16} and B={2, 4, 6, 8, 10, 12, 14, 16}, then but • because every element in A is an element of A. • for any A because the empty set has no elements. • If A is the set of prime numbers and B is the set of odd numbers, then
  • 16. 16 Proper (Strict) Subsets & Supersets • ST (“S is a proper subset of T”) means that ST but . Similar for ST. ST / S T Venn Diagram equivalent of ST Example: {1,2}  {1,2,3} Fact: If A = B, then |A| = |B|. Fact: If , then |A| < |B|.
  • 17. 17 Sets and Subsets (common notations) (a) Z=the set of integers={0,1,-1,2,-1,3,-3,...} (b) N=the set of nonnegative integers or natural numbers (c) Z+=the set of positive integers (d) Q=the set of rational numbers={a/b| a,b is integer, b not zero} (e) Q+=the set of positive rational numbers (f) Q*=the set of nonzero rational numbers (g) R=the set of real numbers (h) R+=the set of positive real numbers (i) R*=the set of nonzero real numbers (j) C=the set of complex numbers
  • 18. 18 Examples of sets The set of all polynomials with degree at most three: {1, x, x2, x3, 2x+3x2,…}. The set of all n-bit strings: {000…0, 000…1, …, 111…1} The set of all triangles without an obtuse angle: { , ,… } The set of all graphs with four nodes: { , , , ,…}
  • 19. 19 The Power Set Operation • The power set P(S) of a set S is the set of all subsets of S. P(S) = {x | xS}. • E.g. P({a,b}) = {, {a}, {b}, {a,b}}. • Sometimes P(S) is written 2S. Note that for finite S, |P(S)| = 2|S|. • It turns out that |P(N)| > |N|. There are different sizes of infinite sets!
  • 20. 20 Sets Are Objects, Too! • The objects that are elements of a set may themselves be sets. • E.g. let S={x | x  {1,2,3}} then P(S)={, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} • Note that 1  {1}  {{1}} !!!!
  • 21. 21 Ordered n-tuples • For nN, an ordered n-tuple or a sequence of length n is written (a1, a2, …, an). The first element is a1, etc. • These are like sets, except that duplicates matter, and the order makes a difference. • Note (1, 2)  (2, 1)  (2, 1, 1). • Empty sequence, singlets, pairs, triples, quadruples, quintuples, …, n-tuples.
  • 22. 22 The Union Operator • For sets A, B, their union AB is the set containing all elements that are either in A, or (“”) in B (or, of course, in both). • Formally, A,B: AB  {x | xA  xB}. • Note that AB contains all the elements of A and it contains all the elements of B: A, B: (AB  A)  (AB  B)
  • 23. 23 • {a,b,c}{2,3} = {a,b,c,2,3} • {2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7} Union Examples
  • 24. 24 The Intersection Operator • For sets A, B, their intersection AB is the set containing all elements that are simultaneously in A and (“”) in B. • Formally, A,B: AB{x | xA  xB}. • Note that AB is a subset of A and it is a subset of B: A, B: (AB  A)  (AB  B)
  • 25. 25 • {a,b,c}{2,3} = ___ • {2,4,6}{3,4,5} = ______ Intersection Examples  {4}
  • 26. 26 Disjointedness • Two sets A, B are called disjoint (i.e., unjoined) iff their intersection is empty. (AB=) • Example: the set of even integers is disjoint with the set of odd integers. Help, I’ve been disjointed!
  • 27. 27 Set Difference • For sets A, B, the difference of A and B, written A−B, is the set of all elements that are in A but not B. • A − B : x  xA  xB = x  ( xA → xB )  • Also called: The complement of B with respect to A.
  • 28. 28 Set Difference Examples • {1,2,3,4,5,6} − {2,3,5,7,9,11} = ___________ • Z − N = {… , -1, 0, 1, 2, … } − {0, 1, … } = {x | x is an integer but not a nat. #} = {x | x is a negative integer} = {… , -3, -2, -1} {1,4,6}
  • 29. 29 Set Difference - Venn Diagram • A-B is what’s left after B “takes a bite out of A” Set A Set B Set A−B Chomp!
  • 30. 30 Set Complements • The universe of discourse can itself be considered a set, call it U. • The complement of A, written , is the complement of A w.r.t. U, i.e., it is U−A. • E.g., If U=N, A ,...}7,6,4,2,1,0{}5,3{ =
  • 31. 31 More on Set Complements • An equivalent definition, when U is clear: }|{ AxxA = A U A
  • 32. 32 Ring Sum (Symmetric Difference) • Let A and B be two non empty sets then ring sum of A and B is set of all elements which are either in A or in B but not in both. • Thus A⊕B={x | x ∈ A∪B but ∉ A∩B} = {x|(x∈A and x∉B)or (x∈B and x ∉A)}
  • 33. 33 Cartesian Products of Sets • For sets A, B, their Cartesian product AB : {(a, b) | aA  bB }. • E.g. {a,b}{1,2} = {(a,1),(a,2),(b,1),(b,2)} • Note that for finite A, B, |AB|=|A||B|. • Note that the Cartesian product is not commutative: AB: AB =BA. • Extends to A1  A2  …  An...
  • 34. 34 Cartesian Product • Let A be the set of letters, i.e. {a,b,c,…,x,y,z}. • Let B be the set of digits, i.e. {0,1,…,9}. AxA is just the set of strings with two letters. BxB is just the set of strings with two digits. AxB is the set of strings where the first character is a letter and the second character is a digit. Definition: Given two sets A and B, the Cartesian product A x B is the set of all ordered pairs (a,b), where a is in A and b is in B. (1,2) ≠ (2,1)
  • 35. 35 Laws of set theory • Identity: A=A AU=A • Domination: AU=U A= • Idempotent: AA = A = AA • Involution: • Commutative: AB=BA AB=BA • Associative: A(BC)=(AB)C A(BC)=(AB)C AA =)(
  • 36. 36 Laws of set theory • Distributive: A∩(BC)=(A∩B)(A∩C) A (BC)=(AB)(AC) • Properties of complement: AAc =U AAc =  c =U Uc= 
  • 37. 37 DeMorgan’s Law for Sets • Exactly analogous to (and derivable from) DeMorgan’s Law for propositions. BABA BABA = =
  • 38. 38 Set Operations and the Laws of Set Theory s dual of s (sd)   U U     Theorem (The Principle of Duality)
  • 39. 39 Partition of sets A collection of nonempty sets {A1, A2, …, An} is a partition of a set A if and only if A1, A2, …, An are mutually disjoint (or pairwise disjoint). e.g. Let A be the set of integers. A1 = {x A | x = 3k+1 for some integer k} A2 = {x A | x = 3k+2 for some integer k} A3 = {x A | x = 3k for some integer k} Then {A1,A2,A3} is a partition of A
  • 40. Partition of sets e.g. Let A be the set of integers divisible by 6. A1 be the set of integers divisible by 2. A2 be the set of integers divisible by 3. Then {A1,A2} is not a partition of A, because A1 and A2 are not disjoint, and also A A1 A2 (so both conditions are not satisfied). e.g. Let A be the set of integers. Let A1 be the set of negative integers. Let A2 be the set of positive integers. Then {A1,A2} is not a partition of A, because A ≠A1 A2 as 0 is contained in A but not contained in A1 A2
  • 41. 41 (Addition Principle / Sum Rule) If sets A and B are disjoint, then |A  B| = |A| + |B| A B What if A and B are not disjoint?
  • 42. 42 Inclusion-Exclusion Principle • How many elements are in AB? |AB| = |A| + |B| − |AB| • Example: {2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7}
  • 43. 43 Inclusion Exclusion (2 sets) For two arbitrary sets A and B |||||||| BABABA −+= A B
  • 44. 44 Inclusion Exclusion (3sets) A B C |A  B  C| = |A| + |B| + |C| – |A  B| – |A  C| – |B  C| + |A  B  C|
  • 45. 45 Inclusion Exclusion (4 sets) A B C |A  B  C  D| = |A| + |B| + |C| + |D| – |A  B| – |A  C| – |A  D| – |B  C| – |B  D| – |C  D| + |A  B  C| + |A  B  D| + |A  C  D| + |B  C  D| – |A  B  C  D | D
  • 46. 46 Inclusion Exclusion (n sets) What is the inclusion-exclusion formula for the union of n sets?
  • 47. 47 Counting and Venn Diagrams • In a class of 50 college freshmen, 30 are studying BASIC, 25 studying PASCAL, and 10 are studying both. How many freshmen are studying either computer language? | | | | | | | |A B A B A B = + −  A B 10 1520