Predicates Sets 110223055946 Phpapp01
-
Upload
chai-jin-ying -
Category
Documents
-
view
215 -
download
0
Transcript of Predicates Sets 110223055946 Phpapp01
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
1/131
Discrete Mathematics
Predicates and Sets
H. Turgut Uyar Ayseg ul Gencata Yayml Emre Harmanc
2001-2013
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
2/131
License
c 2001-2013 T. Uyar, A. Yayml, E. Harmanc
You are free:
to Share to copy, distribute and transmit the work
to Remix to adapt the work
Under the following conditions:
Attribution You must attribute the work in the manner specied by the author or licensor (but not in anyway that suggests that they endorse you or your use of the work).
Noncommercial You may not use this work for commercial purposes.
Share Alike If you alter, transform, or build upon this work, you may distribute the resulting work onlyunder the same or similar license to this one.
Legal code (the full license):http://creativecommons.org/licenses/by-nc-sa/3.0/
http://creativecommons.org/licenses/by-nc-sa/3.0/http://creativecommons.org/licenses/by-nc-sa/3.0/ -
8/10/2019 Predicates Sets 110223055946 Phpapp01
3/131
Topics
1 PredicatesIntroductionQuantiersMultiple Quantiers
2 SetsIntroduction
SubsetSet OperationsInclusion-Exclusion
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
4/131
Topics
1 PredicatesIntroductionQuantiersMultiple Quantiers
2 SetsIntroduction
SubsetSet OperationsInclusion-Exclusion
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
5/131
Predicate
Denition
predicate (or open statement ): a declarative sentence whichcontains one or more variables, andis not a proposition, butbecomes a proposition when the variables in it
are replaced by certain allowable choices
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
6/131
Universe of Discourse
Denitionuniverse of discourse: U set of allowable choices
examples:Z: integersN: natural numbersZ+ : positive integersQ: rational numbersR: real numbersC: complex numbers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
7/131
Universe of Discourse
Denitionuniverse of discourse: U set of allowable choices
examples:Z: integersN: natural numbersZ+ : positive integersQ: rational numbersR: real numbersC: complex numbers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
8/131
Predicate Examples
Example U = Np (x ): x + 2 is an even integer
p (5): F p (8): T
p (x ): x + 2 is not an even integer
Example U = Nq (x , y ): x + y and x 2y are even integers
q (11, 3): F , q (14, 4): T
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
9/131
Predicate Examples
Example U = Np (x ): x + 2 is an even integer
p (5): F p (8): T
p (x ): x + 2 is not an even integer
Example U = Nq (x , y ): x + y and x 2y are even integers
q (11, 3): F , q (14, 4): T
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
10/131
Predicate Examples
Example U = Np (x ): x + 2 is an even integer
p (5): F p (8): T
p (x ): x + 2 is not an even integer
Example U = Nq (x , y ): x + y and x 2y are even integers
q (11, 3): F , q (14, 4): T
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
11/131
Topics
1 PredicatesIntroductionQuantiersMultiple Quantiers
2 SetsIntroduction
SubsetSet OperationsInclusion-Exclusion
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
12/131
Quantiers
Denitionexistential quantier:predicate is true for some values
symbol: read: there exists
symbol: !read: there exists only one
Denitionuniversal quantier:predicate is true for all values
symbol: read: for all
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
13/131
Quantiers
Denitionexistential quantier:predicate is true for some values
symbol: read: there exists
symbol: !read: there exists only one
Denitionuniversal quantier:predicate is true for all values
symbol: read: for all
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
14/131
Quantiers
Denitionexistential quantier:predicate is true for some values
symbol: read: there exists
symbol: !read: there exists only one
Denitionuniversal quantier:predicate is true for all values
symbol: read: for all
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
15/131
Quantiers
existential quantier
U = {x 1, x 2, . . . , x n }x p (x ) p (x 1) p (x 2) p (x n )
p (x ) is true for some x
universal quantier
U = {x 1, x
2, . . . , x n }
x p (x ) p (x 1) p (x 2) p (x n )
p (x ) is true for all x
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
16/131
Quantiers
existential quantier
U = {x 1, x 2, . . . , x n }x p (x ) p (x 1) p (x 2) p (x n )
p (x ) is true for some x
universal quantier
U = {x 1, x 2, . . . , x n }x p (x ) p (x 1) p (x 2) p (x n )
p (x ) is true for all x
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
17/131
Quantier Examples
Example
U = Rp (x ) : x 0q (x ) : x 2 0r (x ) : (x 4)(x + 1) = 0s (x ) : x 2 3 > 0
are the following expressions true?
x [p (x ) r (x )]x [p (x ) q (x )]x [q (x ) s (x )]x [r (x ) s (x )]x [r (x ) p (x )]
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
18/131
Quantier Examples
Example
U = Rp (x ) : x 0q (x ) : x 2 0r (x ) : (x 4)(x + 1) = 0s (x ) : x 2 3 > 0
are the following expressions true?
x [p (x ) r (x )]x [p (x ) q (x )]x [q (x ) s (x )]x [r (x ) s (x )]x [r (x ) p (x )]
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
19/131
Quantier Examples
Example
U = Rp (x ) : x 0q (x ) : x 2 0r (x ) : (x 4)(x + 1) = 0s (x ) : x 2 3 > 0
are the following expressions true?
x [p (x ) r (x )]x [p (x ) q (x )]x [q (x ) s (x )]x [r (x ) s (x )]x [r (x ) p (x )]
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
20/131
Quantier Examples
Example
U = Rp (x ) : x 0q (x ) : x 2 0r (x ) : (x 4)(x + 1) = 0s (x ) : x 2 3 > 0
are the following expressions true?
x [p (x ) r (x )]x [p (x ) q (x )]x [q (x ) s (x )]x [r (x ) s (x )]x [r (x ) p (x )]
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
21/131
Quantier Examples
Example
U = Rp (x ) : x 0q (x ) : x 2 0r (x ) : (x 4)(x + 1) = 0s (x ) : x 2 3 > 0
are the following expressions true?
x [p (x ) r (x )]x [p (x ) q (x )]x [q (x ) s (x )]x [r (x ) s (x )]
x [r (x ) p (x )]
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
22/131
Quantier Examples
Example
U = Rp (x ) : x 0q (x ) : x 2 0r (x ) : (x 4)(x + 1) = 0s (x ) : x 2 3 > 0
are the following expressions true?
x [p (x ) r (x )]x [p (x ) q (x )]x [q (x ) s (x )]x [r (x ) s (x )]
x [r (x ) p (x )]
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
23/131
Negating Quantiers
replace with , and with negate the predicate
x p (x ) x p (x )x p (x ) x p (x )
x p (x ) x p (x )x p (x ) x p (x )
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
24/131
Negating Quantiers
replace with , and with negate the predicate
x p (x ) x p (x )x p (x ) x p (x )
x p (x ) x p (x )x p (x ) x p (x )
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
25/131
Negating Quantiers
Theoremx p (x ) x p (x )
Proof.
x p (x ) [p (x 1) p (x 2) p (x n )] p (x 1) p (x 2) p (x n ) x p (x )
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
26/131
Negating Quantiers
Theoremx p (x ) x p (x )
Proof.
x p (x ) [p (x 1) p (x 2) p (x n )] p (x 1) p (x 2) p (x n ) x p (x )
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
27/131
Negating Quantiers
Theoremx p (x ) x p (x )
Proof.
x p (x ) [p (x 1) p (x 2) p (x n )] p (x 1) p (x 2) p (x n ) x p (x )
N i Q i
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
28/131
Negating Quantiers
Theoremx p (x ) x p (x )
Proof.
x p (x ) [p (x 1) p (x 2) p (x n )] p (x 1) p (x 2) p (x n ) x p (x )
P di E i l
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
29/131
Predicate Equivalences
Theorem
x [p (x ) q (x )] x p (x ) x q (x )
Theoremx [p (x ) q (x )] x p (x ) x q (x )
P di t E i l
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
30/131
Predicate Equivalences
Theorem
x [p (x ) q (x )] x p (x ) x q (x )
Theoremx [p (x ) q (x )] x p (x ) x q (x )
Predicate Implications
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
31/131
Predicate Implications
Theoremx p (x ) x p (x )
Theoremx [p (x ) q (x )] x p (x ) x q (x )
Theoremx p (x ) x q (x ) x [p (x ) q (x )]
Predicate Implications
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
32/131
Predicate Implications
Theoremx p (x ) x p (x )
Theoremx [p (x ) q (x )] x p (x ) x q (x )
Theoremx p (x ) x q (x ) x [p (x ) q (x )]
Predicate Implications
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
33/131
Predicate Implications
Theoremx p (x ) x p (x )
Theoremx [p (x ) q (x )] x p (x ) x q (x )
Theoremx p (x ) x q (x ) x [p (x ) q (x )]
Topics
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
34/131
Topics
1 PredicatesIntroductionQuantiers
Multiple Quantiers
2 SetsIntroduction
SubsetSet OperationsInclusion-Exclusion
Multiple Quantiers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
35/131
Multiple Quantiers
x y p (x , y )x y p (x , y )x y p (x , y )x y p (x , y )
Multiple Quantier Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
36/131
Multiple Quantier Examples
Example
U = Zp (x , y ) : x + y = 17
x y p (x , y ):for every x there exists a y such that x + y = 17y x p (x , y ):there exists a y so that for all x , x + y = 17
what if U = N?
Multiple Quantier Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
37/131
Multiple Quantier Examples
Example
U = Zp (x , y ) : x + y = 17
x y p (x , y ):for every x there exists a y such that x + y = 17y x p (x , y ):there exists a y so that for all x , x + y = 17
what if U = N?
Multiple Quantier Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
38/131
Multiple Quantier Examples
Example
U = Zp (x , y ) : x + y = 17
x y p (x , y ):for every x there exists a y such that x + y = 17y x p (x , y ):there exists a y so that for all x , x + y = 17
what if U = N?
Multiple Quantier Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
39/131
Multiple Quantier Examples
Example
U = Zp (x , y ) : x + y = 17
x y p (x , y ):for every x there exists a y such that x + y = 17y x p (x , y ):there exists a y so that for all x , x + y = 17
what if U = N?
Multiple Quantiers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
40/131
u t p e Qua t e s
Example
U x = {1, 2}U y = {A, B }
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
Multiple Quantiers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
41/131
p Q
Example
U x = {1, 2}U y = {A, B }
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
Multiple Quantiers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
42/131
p Q
Example
U x = {1, 2}U y = {A, B }
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
Multiple Quantiers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
43/131
p Q
Example
U x = {1, 2}U y = {A, B }
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
Multiple Quantiers
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
44/131
p
Example
U x = {1, 2}U y = {A, B }
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
x y p (x , y ) [p (1, A) p (1, B )] [p (2, A) p (2, B )]
References
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
45/131
Required Reading: Grimaldi
Chapter 2: Fundamentals of Logic2.4. The Use of Quantiers
Supplementary Reading: ODonnell, Hall, Page
Chapter 7: Predicate Logic
Topics
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
46/131
1 PredicatesIntroductionQuantiers
Multiple Quantiers
2 SetsIntroductionSubsetSet OperationsInclusion-Exclusion
Set
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
47/131
Denition
set: a collection of elements that aredistinctunorderednon-repeating
Set Representation
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
48/131
explicit representationelements are listed within braces: {a1, a2, . . . , an }
implicit representation
elements that validate a predicate: {x |x G , p (x )}: empty set
let S be a set, and a be an elementa S : a is an element of set S a / S : a is not an element of set S
|S |: number of elements (cardinality)
Set Representation
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
49/131
explicit representationelements are listed within braces: {a1, a2, . . . , an }
implicit representation
elements that validate a predicate: {x |x G , p (x )}: empty set
let S be a set, and a be an elementa S : a is an element of set S a / S : a is not an element of set S
|S |: number of elements (cardinality)
Set Representation
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
50/131
explicit representationelements are listed within braces: {a1, a2, . . . , an }
implicit representation
elements that validate a predicate: {x |x G , p (x )}: empty set
let S be a set, and a be an elementa S : a is an element of set S a / S : a is not an element of set S
|S |: number of elements (cardinality)
Set Representation
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
51/131
explicit representationelements are listed within braces: {a1, a2, . . . , an }
implicit representation
elements that validate a predicate: {x |x G , p (x )}: empty set
let S be a set, and a be an elementa S : a is an element of set S a / S : a is not an element of set S
|S |: number of elements (cardinality)
Set Representation
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
52/131
explicit representationelements are listed within braces: {a1, a2, . . . , an }
implicit representation
elements that validate a predicate: {x |x G , p (x )}: empty set
let S be a set, and a be an elementa S : a is an element of set S a / S : a is not an element of set S
|S |: number of elements (cardinality)
Explicit Representation Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
53/131
Example
{3, 8, 2, 11, 5}11 {3, 8, 2, 11, 5}|{3, 8, 2, 11, 5}| = 5
Implicit Representation Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
54/131
Example
{x |x Z+ , 20 < x 3 < 100} {3, 4}{2x 1|x Z+ , 20 < x 3 < 100} {5, 7}
Example
A = {x |x R, 1 x 5}
Example
E = {n |n N, k N [n = 2k ]}A = {x |x E , 1 x 5}
Implicit Representation Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
55/131
Example
{x |x Z+ , 20 < x 3 < 100} {3, 4}{2x 1|x Z+ , 20 < x 3 < 100} {5, 7}
Example
A = {x |x R, 1 x 5}
Example
E = {n |n N, k N [n = 2k ]}A = {x |x E , 1 x 5}
Implicit Representation Examples
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
56/131
Example
{x |x Z+ , 20 < x 3 < 100} {3, 4}{2x 1|x Z+ , 20 < x 3 < 100} {5, 7}
Example
A = {x |x R, 1 x 5}
Example
E = {n |n N, k N [n = 2k ]}A = {x |x E , 1 x 5}
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
57/131
There is a barber who lives in a small town.He shaves all those men who dont shave themselves.He doesnt shave those men who shave themselves.
Does the barber shave himself?
yes but he doesnt shave men who shave themselves nono but he shaves all men who dont shave themselves yes
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
58/131
There is a barber who lives in a small town.He shaves all those men who dont shave themselves.He doesnt shave those men who shave themselves.
Does the barber shave himself?
yes but he doesnt shave men who shave themselves nono but he shaves all men who dont shave themselves yes
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
59/131
There is a barber who lives in a small town.He shaves all those men who dont shave themselves.He doesnt shave those men who shave themselves.
Does the barber shave himself?
yes but he doesnt shave men who shave themselves nono but he shaves all men who dont shave themselves yes
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
60/131
let S be the set of sets that are not an element of themselvesS = {A|A / A}
Is S an element of itself?
yes but the predicate is not valid nono but the predicate is valid yes
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
61/131
let S be the set of sets that are not an element of themselvesS = {A|A / A}
Is S an element of itself?
yes but the predicate is not valid nono but the predicate is valid yes
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
62/131
let S be the set of sets that are not an element of themselvesS = {A|A / A}
Is S an element of itself?
yes but the predicate is not valid nono but the predicate is valid yes
Set Dilemma
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
63/131
let S be the set of sets that are not an element of themselvesS = {A|A / A}
Is S an element of itself?
yes but the predicate is not valid nono but the predicate is valid yes
Topics
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
64/131
1 PredicatesIntroductionQuantiersMultiple Quantiers
2 SetsIntroductionSubsetSet OperationsInclusion-Exclusion
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
65/131
DenitionA B x [x A x B ]
set equality:A = B (A B ) (B A)proper subset:A B (A B ) (A = B )
S [ S ]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
66/131
DenitionA B x [x A x B ]
set equality:A = B (A B ) (B A)proper subset:A B (A B ) (A = B )
S [ S ]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
67/131
DenitionA B x [x A x B ]
set equality:A = B (A B ) (B A)proper subset:A B (A B ) (A = B )
S [ S ]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
68/131
DenitionA B x [x A x B ]
set equality:A = B (A B ) (B A)proper subset:A B (A B ) (A = B )
S [ S ]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
69/131
not a subset
A B x [x A x B ] x [x A x B ] x [(x A) (x B )] x [(x A) (x B )]
x [(x A) (x / B )]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
70/131
not a subset
A B x [x A x B ] x [x A x B ] x [(x A) (x B )] x [(x A) (x B )]
x [(x A) (x / B )]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
71/131
not a subset
A B x [x A x B ] x [x A x B ] x [(x A) (x B )] x [(x A) (x B )]
x [(x A) (x / B )]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
72/131
not a subset
A B x [x A x B ] x [x A x B ] x [(x A) (x B )] x [(x A) (x B )]
x [(x A) (x / B )]
Subset
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
73/131
not a subset
A B x [x A x B ] x [x A x B ] x [(x A) (x B )] x [(x A) (x B )]
x [(x A) (x / B )]
Power Set
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
74/131
Denitionpower set: P (S )the set of all subsets of a set, including the empty setand the set itself
if a set has n elements, its power set has 2n elements
Power Set
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
75/131
Denitionpower set: P (S )the set of all subsets of a set, including the empty setand the set itself
if a set has n elements, its power set has 2n elements
Example of Power Set
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
76/131
Example
P ({1, 2, 3}) = {,{1}, {2}, {3},{1, 2}, {1, 3}, {2, 3},{1, 2, 3}
}
Topics
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
77/131
1 PredicatesIntroductionQuantiersMultiple Quantiers
2 SetsIntroductionSubset
Set OperationsInclusion-Exclusion
Set Operations
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
78/131
complement
A = {x |x / A}
intersectionA B = {x |(x A) (x B )}
if A B = then A and B are disjoint
unionAB = {x |(x A) (x B )}
Set Operations
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
79/131
complement
A = {x |x / A}
intersectionA B = {x |(x A) (x B )}
if A B = then A and B are disjoint
unionAB = {x |(x A) (x B )}
Set Operations
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
80/131
complement
A = {x |x / A}
intersectionA B = {x |(x A) (x B )}
if A B = then A and B are disjoint
unionAB = {x |(x A) (x B )}
Set Operations
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
81/131
differenceA B = {x |(x A) (x / B )}
A B = A B symmetric difference :A B = {x |(x AB ) (x / A B )}
Set Operations
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
82/131
differenceA B = {x |(x A) (x / B )}
A B = A B symmetric difference :A B = {x |(x AB ) (x / A B )}
Set Operations
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
83/131
differenceA B = {x |(x A) (x / B )}
A B = A B symmetric difference :A B = {x |(x AB ) (x / A B )}
Cartesian Product
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
84/131
DenitionCartesian product :
A B = {(a, b )|a A, b B }A B C N = {(a, b , . . . , n)|a A, b B , . . . , n N }
|A B C N | = |A| | B | | C | | N |
Cartesian Product
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
85/131
DenitionCartesian product :
A B = {(a, b )|a A, b B }A B C N = {(a, b , . . . , n)|a A, b B , . . . , n N }
|A B C N | = |A| | B | | C | | N |
Cartesian Product Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
86/131
ExampleA = {a1.a2, a3, a4}B = {b 1, b 2, b 3}
A B = {(a1, b 1), (a1, b 2), (a1, b 3),(a2, b 1), (a2, b 2), (a2, b 3),(a3, b 1), (a3, b 2), (a3, b 3),(a4, b 1), (a4, b 2), (a4, b 3)
}
Equivalences
D bl C l t
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
87/131
Double Complement
A = A
CommutativityA B = B A AB = B A
Associativity(A B ) C = A (B C ) (AB ) C = A (B C )
IdempotenceA A = A AA = A
InverseA A = AA = U
Equivalences
D bl C l t
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
88/131
Double Complement
A = A
CommutativityA B = B A AB = B A
Associativity(A B ) C = A (B C ) (AB ) C = A (B C )
IdempotenceA A = A AA = A
InverseA A = AA = U
Equivalences
Double Complement
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
89/131
Double Complement
A = A
CommutativityA B = B A AB = B A
Associativity(A B ) C = A (B C ) (AB ) C = A (B C )
IdempotenceA A = A AA = A
InverseA A = AA = U
Equivalences
Double Complement
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
90/131
Double Complement
A = A
CommutativityA B = B A AB = B A
Associativity(A B ) C = A (B C ) (AB ) C = A (B C )
IdempotenceA A = A AA = A
InverseA A = AA = U
Equivalences
Double Complement
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
91/131
Double Complement
A = A
CommutativityA B = B A AB = B A
Associativity(A B ) C = A (B C ) (AB ) C = A (B C )
IdempotenceA A = A AA = A
InverseA A = AA = U
Equivalences
Identity
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
92/131
Identity
A U = A A = A
DominationA = AU = U
DistributivityA (B C ) = ( A B ) (A C ) A (B C ) = ( AB ) (AC )
AbsorptionA (AB ) = A A (A B ) = A
DeMorgans LawsA B = AB AB = A B
Equivalences
Identity
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
93/131
Identity
A U = A A = A
DominationA = AU = U
DistributivityA (B C ) = ( A B ) (A C ) A (B C ) = ( AB ) (AC )
AbsorptionA (AB ) = A A (A B ) = A
DeMorgans LawsA B = AB AB = A B
Equivalences
Identity
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
94/131
Identity
A U = A A = A
DominationA = AU = U
DistributivityA (B C ) = ( A B ) (A C ) A (B C ) = ( AB ) (AC )
AbsorptionA (AB ) = A A (A B ) = A
DeMorgans LawsA B = AB AB = A B
Equivalences
Identity
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
95/131
Identity
A U = A A = A
DominationA = AU = U
DistributivityA (B C ) = ( A B ) (A C ) A (B C ) = ( AB ) (AC )
AbsorptionA (AB ) = A A (A B ) = A
DeMorgans LawsA B = AB AB = A B
Equivalences
Identity
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
96/131
Identity
A U = A A = A
DominationA = AU = U
DistributivityA (B C ) = ( A B ) (A C ) A (B C ) = ( AB ) (AC )
AbsorptionA (AB ) = A A (A B ) = A
DeMorgans LawsA B = AB AB = A B
DeMorgans Laws
P f
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
97/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
P f
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
98/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
P f
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
99/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
100/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
101/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
102/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
103/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
DeMorgans Laws
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
104/131
Proof.
A B = {x |x / (A B )}= {x | (x (A B ))}
= {x | ((x A) (x B ))}= {x | (x A) (x B )}= {x |(x / A) (x / B )}= {x |(x A) (x B )}
= {x |x AB }= AB
Example of Equivalence
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
105/131
TheoremA (B C ) = ( A B ) (A C )
Equivalence Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
106/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Equivalence Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
107/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Equivalence Example
P f
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
108/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Equivalence Example
P f
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
109/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Equivalence Example
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
110/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Equivalence Example
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
111/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Equivalence Example
Proof
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
112/131
Proof.
(A B ) (A C ) = ( A B ) (A C )= ( A B ) (AC )= (( A B ) A) ((A B ) C ))= ((A B ) C ))= ( A B ) C = A (B C )= A (B C )
Topics
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
113/131
1 PredicatesIntroductionQuantiersMultiple Quantiers
2 SetsIntroductionSubset
Set OperationsInclusion-Exclusion
Principle of Inclusion-Exclusion
|AB | = |A| + |B | | A B |
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
114/131
| | | | | | | ||AB C | =|A| + |B | + |C | (|A B | + |A C | + |B C |) + |A B C |
Theorem
|A1 A2 An | =i
|Ai | i , j
|Ai A j |
+i , j , k
|Ai A j Ak |
+ 1n 1 |Ai A j An |
Principle of Inclusion-Exclusion
|AB | = |A| + |B | | A B |
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
115/131
| | | | | | | ||AB C | =|A| + |B | + |C | (|A B | + |A C | + |B C |) + |A B C |
Theorem
|A1 A2 An | =i
|Ai | i , j
|Ai A j |
+i , j , k
|Ai A j Ak |
+ 1n 1 |Ai A j An |
Principle of Inclusion-Exclusion
|AB | = |A| + |B | | A B |
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
116/131
| | | | | | | ||AB C | =|A| + |B | + |C | (|A B | + |A C | + |B C |) + |A B C |
Theorem
|A1 A2 An | =i
|Ai | i , j
|Ai A j |
+i , j , k
|Ai A j Ak |
+ 1n 1 |Ai A j An |
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
117/131
Example (sieve of Eratosthenes)
a method to identify prime numbers2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 302 3 5 7 9 11 13 15 17
19 21 23 25 27 29
2 3 5 7 11 13 1719 23 25 29
2 3 5 7 11 13 17
19 23 29
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
118/131
Example (sieve of Eratosthenes)
a method to identify prime numbers2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 302 3 5 7 9 11 13 15 17
19 21 23 25 27 29
2 3 5 7 11 13 1719 23 25 29
2 3 5 7 11 13 17
19 23 29
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
119/131
Example (sieve of Eratosthenes)
a method to identify prime numbers2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 302 3 5 7 9 11 13 15 17
19 21 23 25 27 29
2 3 5 7 11 13 1719 23 25 29
2 3 5 7 11 13 17
19 23 29
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
120/131
Example (sieve of Eratosthenes)
a method to identify prime numbers2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 302 3 5 7 9 11 13 15 17
19 21 23 25 27 29
2 3 5 7 11 13 1719 23 25 29
2 3 5 7 11 13 17
19 23 29
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
121/131
Example (sieve of Eratosthenes)
a method to identify prime numbers2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 302 3 5 7 9 11 13 15 17
19 21 23 25 27 29
2 3 5 7 11 13 1719 23 25 29
2 3 5 7 11 13 17
19 23 29
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
122/131
Example (sieve of Eratosthenes)
number of primes between 1 and 100
numbers that are not divisible by 2, 3, 5 and 7A2: set of numbers divisible by 2A3: set of numbers divisible by 3A5: set of numbers divisible by 5A7: set of numbers divisible by 7
|A2 A3 A5 A7 |
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
123/131
Example (sieve of Eratosthenes)
number of primes between 1 and 100
numbers that are not divisible by 2, 3, 5 and 7A2: set of numbers divisible by 2A3: set of numbers divisible by 3A5: set of numbers divisible by 5A7: set of numbers divisible by 7
|A2 A3 A5 A7 |
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
124/131
Example (sieve of Eratosthenes)
number of primes between 1 and 100
numbers that are not divisible by 2, 3, 5 and 7A2: set of numbers divisible by 2A3: set of numbers divisible by 3A5: set of numbers divisible by 5A7: set of numbers divisible by 7
|A
2 A
3 A
5 A
7 |
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
125/131
Example (sieve of Eratosthenes)
|A2| = 100/ 2 = 50
|A3| = 100/ 3 = 33|A5| = 100/ 5 = 20|A7| = 100/ 7 = 14
|A2 A3 | = 100/ 6 = 16
|A2 A5 | = 100/ 10 = 10|A2 A7 | = 100/ 14 = 7|A3 A5 | = 100/ 15 = 6|A3 A7 | = 100/ 21 = 4
|A5 A7 | = 100/ 35 = 2
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
126/131
Example (sieve of Eratosthenes)
|A2| = 100/ 2 = 50
|A3| = 100/ 3 = 33|A5| = 100/ 5 = 20|A7| = 100/ 7 = 14
|A2 A3 | = 100/ 6 = 16
|A2 A5 | = 100/ 10 = 10|A2 A7 | = 100/ 14 = 7|A3 A5 | = 100/ 15 = 6|A3 A7 | = 100/ 21 = 4
|A5 A7 | = 100/ 35 = 2
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
127/131
Example (sieve of Eratosthenes)
|A2 A3 A5| = 100/ 30 = 3|A2 A3 A7| = 100/ 42 = 2|A2 A5 A7| = 100/ 70 = 1|A3 A5 A7| = 100/ 105 = 0
|A2 A3 A5 A7 | = 100/ 210 = 0
Inclusion-Exclusion Example
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
128/131
Example (sieve of Eratosthenes)
|A2 A3 A5| = 100/ 30 = 3|A2 A3 A7| = 100/ 42 = 2|A2 A5 A7| = 100/ 70 = 1|A3 A5 A7| = 100/ 105 = 0
|A2 A3 A5 A7 | = 100/ 210 = 0
Inclusion-Exclusion Example
E l ( i f E t th )
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
129/131
Example (sieve of Eratosthenes)
|A2 A3 A5 A7 | = (50 + 33 + 20 + 14)
(16 + 10 + 7 + 6 + 4 + 2)
+ (3 + 2 + 1 + 0) (0)= 78
number of primes: (100 78) + 4 1 = 25
Inclusion-Exclusion Example
E l ( i f E t th )
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
130/131
Example (sieve of Eratosthenes)
|A2 A3 A5 A7 | = (50 + 33 + 20 + 14) (16 + 10 + 7 + 6 + 4 + 2)+ (3 + 2 + 1 + 0) (0)= 78
number of primes: (100 78) + 4 1 = 25
References
Required Reading: Grimaldi
-
8/10/2019 Predicates Sets 110223055946 Phpapp01
131/131
Required Reading: GrimaldiChapter 3: Set Theory
3.1. Sets and Subsets3.2. Set Operations and the Laws of Set Theory
Chapter 8: The Principle of Inclusion and Exclusion8.1. The Principle of Inclusion and Exclusion
Supplementary Reading: ODonnell, Hall, Page
Chapter 8: Set Theory