尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
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

Set, Relations and Functions
Set, Relations and FunctionsSet, Relations and Functions
Set, Relations and Functions
suthi
 
SET THEORY
SET THEORYSET THEORY
SET THEORY
Lena
 
Set concepts
Set conceptsSet concepts
Set concepts
Malti Aswal
 
Set Theory
Set TheorySet Theory
Set Theory
itutor
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
Usama ahmad
 
The basic concept of sets
The basic concept of setsThe basic concept of sets
The basic concept of sets
PRINTDESK by Dan
 
Chapter 1, Sets
Chapter   1, SetsChapter   1, Sets
Chapter 1, Sets
Ananya Sharma
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
Raju Ahmed Rony
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
Rachana Pathak
 
Types of sets
Types of setsTypes of sets
Types of sets
Mahitha Davala
 
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDiscrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Dr. Khaled Bakro
 
Set theory-ppt
Set theory-pptSet theory-ppt
Set theory-ppt
vipulAtri
 
Function and Its Types.
Function and Its Types.Function and Its Types.
Function and Its Types.
Awais Bakshy
 
Sets in discrete mathematics
Sets in discrete mathematicsSets in discrete mathematics
Sets in discrete mathematics
University of Potsdam
 
Set Theory Presentation
Set Theory PresentationSet Theory Presentation
Set Theory Presentation
Mohammad Saffat-E-Nayeem
 
Set operations
Set operationsSet operations
Set operations
rajshreemuthiah
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relations
nszakir
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
SURBHI SAROHA
 
sets and venn diagrams
sets and venn diagramssets and venn diagrams
sets and venn diagrams
Shahmir Ali
 
types of sets
types of setstypes of sets
types of sets
jayzorts
 

What's hot (20)

Set, Relations and Functions
Set, Relations and FunctionsSet, Relations and Functions
Set, Relations and Functions
 
SET THEORY
SET THEORYSET THEORY
SET THEORY
 
Set concepts
Set conceptsSet concepts
Set concepts
 
Set Theory
Set TheorySet Theory
Set Theory
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
 
The basic concept of sets
The basic concept of setsThe basic concept of sets
The basic concept of sets
 
Chapter 1, Sets
Chapter   1, SetsChapter   1, Sets
Chapter 1, Sets
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
 
Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
 
Types of sets
Types of setsTypes of sets
Types of sets
 
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDiscrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
 
Set theory-ppt
Set theory-pptSet theory-ppt
Set theory-ppt
 
Function and Its Types.
Function and Its Types.Function and Its Types.
Function and Its Types.
 
Sets in discrete mathematics
Sets in discrete mathematicsSets in discrete mathematics
Sets in discrete mathematics
 
Set Theory Presentation
Set Theory PresentationSet Theory Presentation
Set Theory Presentation
 
Set operations
Set operationsSet operations
Set operations
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relations
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
 
sets and venn diagrams
sets and venn diagramssets and venn diagrams
sets and venn diagrams
 
types of sets
types of setstypes of sets
types of sets
 

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
 
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
 
sets.pptx
sets.pptxsets.pptx

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
 
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
 
sets.pptx
sets.pptxsets.pptx
sets.pptx
 

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

🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
dulbh kashyap
 
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl LucknowCall Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
yogita singh$A17
 
Cuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort Service
Cuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort ServiceCuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort Service
Cuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort Service
yakranividhrini
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...
Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...
Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...
shourabjaat424
 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
sathishkumars808912
 
Cricket management system ptoject report.pdf
Cricket management system ptoject report.pdfCricket management system ptoject report.pdf
Cricket management system ptoject report.pdf
Kamal Acharya
 
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
AK47
 
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book NowKandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
SONALI Batra $A12
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
gapboxn
 
SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )
Tsuyoshi Horigome
 
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
aarusi sexy model
 
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Dr.Costas Sachpazis
 
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Tsuyoshi Horigome
 
The Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC Conduit
The Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC ConduitThe Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC Conduit
The Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC Conduit
Guangdong Ctube Industry Co., Ltd.
 
❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...
❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...
❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...
nainakaoornoida
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
ShurooqTaib
 
Microsoft Azure AD architecture and features
Microsoft Azure AD architecture and featuresMicrosoft Azure AD architecture and features
Microsoft Azure AD architecture and features
ssuser381403
 
Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine
 
Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...
Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...
Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...
simrangupta87541
 

Recently uploaded (20)

🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
 
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl LucknowCall Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
 
Cuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort Service
Cuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort ServiceCuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort Service
Cuttack Call Girls 💯Call Us 🔝 7374876321 🔝 💃 Independent Female Escort Service
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...
Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...
Call Girls Chandigarh 🔥 7014168258 🔥 Real Fun With Sexual Girl Available 24/7...
 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
 
Cricket management system ptoject report.pdf
Cricket management system ptoject report.pdfCricket management system ptoject report.pdf
Cricket management system ptoject report.pdf
 
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
 
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book NowKandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )
 
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
 
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
 
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
 
The Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC Conduit
The Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC ConduitThe Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC Conduit
The Differences between Schedule 40 PVC Conduit Pipe and Schedule 80 PVC Conduit
 
❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...
❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...
❣Independent Call Girls Chennai 💯Call Us 🔝 7737669865 🔝💃Independent Chennai E...
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
 
Microsoft Azure AD architecture and features
Microsoft Azure AD architecture and featuresMicrosoft Azure AD architecture and features
Microsoft Azure AD architecture and features
 
Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024
 
Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...
Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...
Mahipalpur Call Girls Delhi 🔥 9711199012 ❄- Pick Your Dream Call Girls with 1...
 

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
  翻译: