Sunteți pe pagina 1din 127

Republic of the Philippines

Laguna State Polytechnic University


Province of Laguna
College of Arts and Sciences

SET THEORY
Prepared by: Victor A. Estalilla Jr.
Set
o A set

o The elements

o Subsets

o Empty set/Null set

o Universal set
Examples

 The collection of the vowels in the word “probability”.

 The collection of real numbers that satisfy the equation x2  9  0

 The collection of two-digit positive integers divisible by 5.

 The collection of great football players in the National Football

League.

 The collection of intelligent members of the United States Congress.


Ways of Describing Sets

A= 1,2,3,4,5,6

A=Integers x 1  x  6
Notation

o Sets are usually designated with capital letters.

o Elementsof a set are usually designated with


lower case letters.
Roster Method
o The roster method of specifying a set consists
of surrounding the collection of elements with
braces.
Example – roster method

For example the set of counting numbers from 1


to 5 would be written as
{1, 2, 3, 4, 5}.
Example – roster method
A variation of the simple roster method uses the ellipsis
( … ) when the pattern is obvious and the set is
large.
{1, 3, 5, 7, … , 9007} is the set of odd
counting numbers less than or equal to
9007.
{1, 2, 3, … } is the set of all counting
numbers.
Set Builder
 Set builder notation has the general form

{variable | descriptive statement }.


The vertical bar (in set builder notation) is always read as “such
that”.

Set builder notation is frequently used when the roster method


is either inappropriate or inadequate.
Notation – is an element of
 If x is an element of the set A, we write this as x
 A. x  A means x is not an element of A.
If A = {3, 17, 2 } then
3  A, 17  A, 2  A and 5  A.

If A = { x | x is a prime number } then


5  A, and 6  A.
Venn Diagrams
It is frequently very helpful to depict a
set in the abstract as the points inside
a circle ( or any other closed shape ).

We can picture the set A as


the points inside the circle
shown here.
Venn Diagrams
To learn a bit more about Venn
diagrams and the man John Venn
who first presented these diagrams
click on the history icon at the right.
Venn Diagrams
Venn Diagrams are used in mathematics,
logic, theological ethics, genetics, study
of Hamlet, linguistics, reasoning, and
many other areas.
The Empty Set

 The set with no elements.

 Also called the null set.

 Denoted by the symbol f.

 Example: The set of real numbers x that satisfy the

equation x 2  1  0
Subset

 The set A is a subset of the set B if every


element of A is an element of B.

 If A is a subset of B and B contains elements


which are not in A, then A is a proper subset of
B.
Notation - Subset
If A is a subset of B we write
A  B to designate that relationship.

If A is a proper subset of B we write


A  B to designate that relationship.

If A is not a subset of B we write


A  B to designate that relationship.
Example - Subset
The set A = {1, 2, 3} is a subset of the set B ={1, 2, 3,
4, 5, 6} because each element of A is an element of B.

We write A  B to designate this relationship


between A and B.

We could also write


{1, 2, 3}  {1, 2, 3, 4, 5, 6}
Example - Subset
The set A = {3, 5, 7} is not a subset of the set B
= {1, 4, 5, 7, 9} because 3 is an element of A
but is not an element of B.

The empty set is a subset of every set, because


every element of the empty set is an element of
every other set.
Example - Subset
The set
A = {1, 2, 3, 4, 5} is a subset of the set
B = {x | x < 6 and x is a counting number}
because every element of A is an element
of B.
Notice also that B is a subset of A because every
element of B is an element of A.
EQUALITY
 Two sets A and B are equal if A  B and B  A.
If two sets A and B are equal we write A = B to
designate that relationship.
Example - Equality

The sets
A = {3, 4, 6} and B = {6, 3, 4} are
equal because A  B and B  A.

The definition of equality of sets shows that the


order in which elements are written does not
affect the set.
Example - Equality
If A = {1, 2, 3, 4, 5} and
B = {x | x < 6 and x is a counting number}
then A is a subset of B because every element
of A is an element of B and B is a subset of A
because every element of B is an element of A.

Therefore the two sets are equal and


we write A = B.
Intersection

 The intersection of two sets A and B is the set


containing those elements which are
elements of A and elements of B.

We write A  B
Example - Intersection

If A = {3, 4, 6, 8} and
B = { 1, 2, 3, 5, 6} then
A  B = {3, 6}
Example - Intersection
If A is the set of prime numbers and
B is the set of even numbers then
A∩B={2}

If A = {x | x > 5 } and
B = {x | x < 3 } then
A∩B=
Example - Intersection
If A = {x | x < 4 } and
B = {x | x >1 } then
A ∩ B = {x | 1 < x < 4 }

If A = {x | x > 4 } and
B = {x | x >7 } then
A ∩ B = {x | x < 7 }
Venn Diagram - Intersection
A is represented by the red circle and B is
represented by the blue circle.
When B is moved to overlap a
portion of A, the purple
colored region
illustrates the intersection
A∩B
of A and B
Union

 The union of two sets A and B is the set


containing those elements which are
elements of A or elements of B.

We write A  B
Example - Union

If A = {3, 4, 6} and
B = { 1, 2, 3, 5, 6} then
A  B = {1, 2, 3, 4, 5, 6}.
Example - Union
If A is the set of prime numbers and
B is the set of even numbers then
A  B = {x | x is even or x is prime }.

If A = {x | x > 5 } and
B = {x | x < 3 } then
A  B = {x | x < 3 or x > 5 }.
Venn Diagram - Union
A is represented by the red circle and B is
represented by the blue circle.
The purple colored region
illustrates the intersection.
The union consists of all
points which are colored
red or blue or purple.
Algebraic Properties
 Union and intersection are commutative
operations.

AB=BA

A∩B=B∩A
Algebraic Properties

 Union and intersection are associative


operations.

(A  B)  C = A  (B  C)

(A ∩ B) ∩ C = B ∩ (A ∩ C)
Algebraic Properties

 Two distributive laws are true.

A ∩ ( B  C )= (A ∩ B)  (A ∩ C)

A  ( B ∩ C )= (A  B) ∩ (A  C)
Algebraic Properties
A few other elementary properties of
intersection and union.

A   =A A∩=

AA=A A∩A=A
Finite and Infinite Sets

 A finite set is one which can be counted.

 Example: The set of two-digit positive integers has 90

elements.

 An infinite set is one which cannot be counted.

 Example: The set of integer multiples of the number 5.


The Cardinality of a Set
 Notation: n(A)

 For finite sets A, n(A) is the number of elements of


A.

 For infinite sets A, write n(A)=∞.


Specifying a Set
 List the elements explicitly, e.g.,
C   a, o, i 
 List the elements implicitly, e.g.,
K   10, 15, 20, 25,...., 95 
 Use set builder notation, e.g.,

Q   x x  p / q where p and q are integers and q  0 


The Universal Set
 A set U that includes all of the elements under
consideration in a particular discussion.
 Depends on the context.
 Examples: The set of Latin letters, the set of natural
numbers, the set of points on a line.
The Membership Relation
 Let A be a set and let x be some object.
 Notation:
 Meaning: x is a member of A, or x is an element of
A, or x belongs to A.
 Negated by writing
 Example: . , .
Equality of Sets
 Two sets A and B are equal, denoted A=B, if they have the
same elements.
 Otherwise, A≠B.
 Example: The set A of odd positive integers is not equal to
the set B of prime numbers.
 Example: The set of odd integers between 4 and 8 is equal to
the set of prime numbers between 4 and 8.
Subsets

 A is a subset of B if every element of A is an element of B.

 Notation: A B

 For each set A, A  A

 For each set B, Ø B

 A is proper subset of B if A B and A B


Unions
 The union of two sets A and B is

A  B   x x  A or x  B

 The word “or” is inclusive.


Intersections
 The intersection of A and B is

A  B   x x  A and x  B

 Example: Let A be the set of even positive integers and B the


set of prime positive integers. Then

A  B  {2}
 Definition: A and B are disjoint if

A B  Ø
Complements
o If A is a subset of the universal set U, then the complement of
A is the set

Ac   x U x  A 

o Note: A  A  
c
; A  A c
U
Venn Diagrams

A
Possible Venn Diagrams
for Two Sets
A

UA U
A

U
A
The Complement of a Set
The shaded region represents the complement of the set A

Ac A
The Union of Two Sets

U
The Intersection of Two Sets

A
Boolean Algebra
When dealing with sets, we have operations ∩, ∪ and 0. The

manipulation of expressions involving these symbols is called Boolean

algebra (after George Boole, 1815–1864). The identities of Boolean

algebra∗ are as follows. (A, B and C denote * Or “laws” of Boolean

algebra. arbitrary sets all of which are subsets of U.)


Commutative Laws Associative Laws
A∩(B∩C) = (A∩B)∩C
A∩B = B∩A
A∪(B∪C) = (A∪B)∪C
A∪B = B∪A
Distributive Laws
Idempotent Laws
A∩(B∪C) = (A∩B)∪(A∩C)
A∩A = A
A∪(B∩C) = (A∪B)∩(A∪C)
A∪A = A
Absorbtion Laws U’ = ∅
A∩(A∪B) = A A∪A’ = U
A∪(A∩B) = A ∅’ = U
Identity Laws De Morgan’s laws
A∩U = A (A∩B)’ = A’∪B’
A∪U = U (A∪B)’ = A’∩B’
A∪∅ = A
A∩∅ = ∅
Complement Laws
(A’)’ = A
A∩A’= ∅
Boolean Algebra
 Boolean Algebra
 When we learned numbers like 1, 2, 3, we also then learned how to add, multiply,
etc. with them. Boolean Algebra covers operations that we can do with 0’s and 1’s.
Computers do these operations ALL THE TIME and they are basic building blocks of
computation inside your computer program.

 Axioms, laws, theorems


 We need to know some rules about how those 0’s and 1’s can be operated on
together. There are similar axioms to decimal number algebra, and there are some
laws and theorems that are good for you to use to simplify your operation.
Boolean Algebra
 A Boolean algebra comprises...
 A set of elements B
 Binary operators {+ , •} Boolean sum and product
 A unary operation { ' } (or { }) example: A’ or A

 …and the following axioms


 1. The set B contains at least two elements {a b} with a  b
 2. Closure: a+b is in B a•b is in B
 3. Commutative: a+b = b+a a•b = b•a
 4. Associative: a+(b+c) = (a+b)+c a•(b•c) = (a•b)•c
 5. Identity: a+0 = a a•1 = a
 6. Distributive: a+(b•c)=(a+b)•(a+c) a•(b+c)=(a•b)+(a•c)
 7. Complementarity: a+a' = 1 a•a' = 0
Digital (binary) logic is a Boolean algebra

 Substitute
 {0, 1} for B
 AND for • Boolean Product. In CSE 321 this was 
 OR for + Boolean Sum. In CSE 321 this was 
 NOT for ‘ Complement. In CSE 321 this was 

 All the axioms hold for binary logic

 Definitions
 Boolean function
 Maps inputs from the set {0,1} to the set {0,1}
 Boolean expression
 An algebraic statement of Boolean variables and operators
Logic Gates (AND, OR, Not) & Truth
Table
• AND X•Y XY X
0
Y
0
Z
0
0 1 0
1 0 0
1 1 1

• OR X+Y X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
• NOT X X' X Y
0 1
1 0
Logic functions and Boolean algebra
 Any logic function that is expressible as a truth table can be written in
Boolean algebra using +, •, and '
Some notation
 Priorities: A  B+ C = ((A)  B) + C
 Variables and their complements are sometimes called literals
Two key concepts
 Duality (a meta-theorem— a theorem about theorems)
 All Boolean expressions have logical duals
 Any theorem that can be proved is also proved for its dual
 Replace: • with +, + with •, 0 with 1, and 1 with 0
 Leave the variables unchanged

 de Morgan’s Theorem
 Procedure for complementing Boolean functions
 Replace: • with +, + with •, 0 with 1, and 1 with 0
 Replace all variables with their complements
Useful laws and theorems
Identity: X+0=X Dual: X • 1 = X
Null: X+1=1 Dual: X • 0 = 0
Idempotent: X+X=X Dual: X • X = X
Involution: (X')' = X
Complementarity: X + X' = 1 Dual: X • X' = 0
Commutative: X+Y=Y+X Dual: X • Y = Y • X
Associative: (X+Y)+Z=X+(Y+Z) Dual: (X•Y)•Z=X•(Y•Z)
Distributive: X•(Y+Z)=(X•Y)+(X•Z) Dual: X+(Y•Z)=(X+Y)•(X+Z)
Uniting: X•Y+X•Y'=X Dual: (X+Y)•(X+Y')=X
Useful laws and theorems (con’t)
Absorption: X+X•Y=X Dual: X•(X+Y)=X
Absorption (#2): (X+Y')•Y=X•Y Dual: (X•Y')+Y=X+Y
de Morgan's: (X+Y+...)'=X'•Y'•... Dual: (X•Y•...)'=X'+Y'+...
Duality: (X+Y+...)D=X•Y•... Dual: (X•Y•...)D=X+Y+…

Multiplying & factoring: Dual: X•Y+X'•Z=(X+Z)•(X'+Y)


(X+Y)•(X'+Z)=X•Z+X'•Y

Consensus: Dual: (X+Y)•(Y+Z)•(X'+Z)=(X+Y)•(X'+Z)


(X•Y)+(Y•Z)+(X'•Z)= X•Y+X'•Z
Proving theorems
 Example 1: Prove the uniting theorem-- X•Y+X•Y'=X
Distributive X•Y+X•Y' = X•(Y+Y')
Complementarity = X•(1)
Identity =X

 Example 2: Prove the absorption theorem-- X+X•Y=X


Identity X+X•Y = (X•1)+(X•Y)
Distributive = X•(1+Y)
Null = X•(1)
Identity =X
Proving theorems
 Example 3: Prove the consensus theorem-- (XY)+(YZ)+(X'Z)=
XY+X'Z
Complementarity XY+YZ+X'Z = XY+(X+X')YZ + X'Z
Distributive = XYZ+XY+X'YZ+X'Z
Use absorption {AB+A=A} with A=XY and B=Z

= XY+X'YZ+X'Z
Rearrange terms = XY+X'ZY+X'Z
Use absorption {AB+A=A} with A=X'Z and B=Y

XY+YZ+X'Z = XY+X'Z
De Morgan’s Theorem
 Use de Morgan’s Theorem to find complements

 Example: F=(A+B)•(A’+C), so F’=(A’•B’)+(A•C’)


One more example of logic simplification

 Example:
Z = A'BC + AB'C' + AB'C + ABC' + ABC

= A'BC + AB'(C’ + C) + AB(C' + C) distributive


= A'BC + AB’ + AB complementary
= A'BC + A(B' + B) distributive
= A'BC +A complementary
= BC + A absorption #2 Duality
(X •Y')+Y=X+Y with X=BC and Y=A
Proving inclusions of sets
Proving inclusions of sets To prove the property A ⊆ B for particular∗
sets A and * particular = individual, specific B we have to prove that
every element of A is an element of B (see definition of ⊆). Sometimes
this is clear.∗ But if not * clear = obvious, self-evident proceed as in the
next examples.
Example. Let A = {x ∈R : x2 −3x + 2 = 0}. Prove that A ⊆Z.
Propositional Logic

• Propositional Logic is the logic


involving complex claims as
constructed from atomic claims and
boolean connectives.
Truth-Functional Connectives
• Boolean Connectives are usually called truth-
functional connectives.
• The truth value of a complex claim that has been
constructed using a truth-functional connective is a
function of the truth value of the claims that are being
connected by that connective.
Negation
• The claim “a is not to the right of b” is a complex claim. It
consists of the atomic claim “a is to the right of b” and the
truth-functional connective “not”.
• We will call the above statement a negation.
• To express negations, we use the symbol ‘’
• ‘’ should be put in front of what you want to be negated.
• Thus, the above statement will be symbolized as:
RightOf(a,b)
Truth-Table for Negation
• ‘’ is truth-functional, since the truth-value of a negation is
the exact opposite of the truth-value of the statement it
negates.
• We can express this using a truth table:
Conjunction
• The claim “a is to the right of b, and a is in front of
b” is called a conjunction.
• The two claims that are being conjuncted in a
conjunction are called its conjuncts.
• To express conjunctions, we will use the symbol ‘’
• ‘’ should be put between the two claims.
• Thus, the above statement will be symbolized as:
RightOf(a,b)  FrontOf(a,b)
Truth-Table for Conjunction
• ‘’ is truth-functional, since a conjunction is true when
both conjuncts are true, and it is false otherwise.
• Again, we can show this using a truth table:
Disjunction
• The claim “a is to the right of b, or a is in front of b”
is called a disjunction.
• The two claims that are being disjuncted in a
disjunction are called its disjuncts.
• To express disjunctions, we will use the symbol ‘’
• ‘’ should be put between the two claims.
• Thus, the above statement will be symbolized as:
RightOf(a,b)  FrontOf(a,b)
Truth-Table for Disjunction
• ‘’ is truth-functional, since a disjunction is true when at
least one of its disjuncts is true, and it is false otherwise.
• Again, we can show this using a truth table:
Combining Complex Claims:
Parentheses
• Using the truth-functional connectives, we can
combine complex claims to make even more
complex claims.
• We are going to use parentheses to indicate the exact
order in which claims are being combined.
• Example: (P  Q)  (R  S) is a conjunction of two
disjunctions.
Parentheses and Ambiguity
• An ambiguous statements is a statement whose meaning
is not clear due to its syntax. Example : ”P or Q and R”
• In formal systems, an expression like P  Q  R is
simply not allowed and considered unsyntactical.
• Claims in our formal language are therefore never
ambiguous.
• One important application of the use of formal
languages is exactly this: to avoid ambiguities!
Exclusive Disjunction vs Inclusive
Disjunction
• Notice that the disjunction as defined by ‘’ is
considered to be true if both disjuncts are true. This
is called an inclusive disjunction.
• However, when I say “a natural number is either
even or odd”, I mean to make a claim that would be
considered false if a number turned out to be both
even and odd. Thus, I am trying to express an
exclusive disjunction.
How to express Exclusive

Disjunctions
We could define a separate symbol for exclusive disjunctions, but we are
not going to do that.
• Fortunately, exclusive disjunctions can be expressed using the symbols
we already have: (PQ)  (PQ)
Logically Equivalent Statements
• Two statements are logically equivalent if their
truth-conditions are identical.
• Simply put, two statements are logically
equivalent if it is impossible for one statement to
be true while the other is false.
• To express that two statements P and Q are
logically equivalent, we will write: PQ
Some Important Equivalences
• Double Negation:
– PP
• DeMorgan:
– (P  Q)  P  Q
– (P  Q)  P  Q
• Distribution:
– P  (Q  R)  (P  Q)  (P  R)
– P  (Q  R)  (P  Q)  (P  R)
Some Important Equivalences
• Commutation:
– PQQP
– PQQP
• Association:
– P  (Q  R)  (P  Q)  R
– P  (Q  R)  (P  Q)  R
• Idempotence:
– PPP
– PPP
Tautologies
• A tautology is a statement that is
necessarily true.
• Example: P  P
• Any statement that evaluates to True in
every row of its truth-table is a tautology.
Contradictions
• A contradiction is a statement that is
necessarily false.
• Example: P  P
• Any statement that evaluates to False in
every row of its truth-table is a
contradiction.
Equivalences
• Two statements are equivalent if they have the
exact same truth-conditions.
• Example: P and P
• In every row of their combined truth-table, two
equivalent statements are either both true or
both false.
Implication
• One statement implies a second statement if it is
impossible for the second statement to be false whenever
the first statement is true.
• Example: P implies P  Q
• In the combined truth-table, there is not a single row
where the implying statement is true and the implies
statement is false
Consistency
• A set of statements is consistent if it is possible
for all of them to be true at the same time.
• Example: {P, P  Q, Q}
• In the combined truth-table of a consistent set of
statements there is at least one row where they all
evaluate to True.
Validity
• An argument is valid if it is impossible for the
conclusion to be false whenever all of its premises
are true.
• Example: P, P  Q  Q
• In the combined truth-table of a valid argument,
there is not a single row where all premises are true
and the conclusion is false.
The Principle of Substitution of
Logical Equivalents
• Let us write S(P) for a sentence which has P as a component
part, and let us write S(Q) for the result of substituting Q for P
in S(P).
• The principle of substitution of logical equivalents states that if
P  Q, then S(P)  S(Q).
• Example:
• Since Small(a)  Small(a), it is also true that (Cube(a) 
Small(a))  (Cube(a)  Small(a))
Simplifying Statements
• Using the principle of substitution of logical equivalents, and using
the logical equivalences that we saw before (Double Negation,
Association, Commutation, Idempotence, DeMorgan, and
Distibution), we can often simplify statements.
• Example:
(A  B)  A  (Commutation)
(B  A)  A  (Association)
B  (A  A)  (Idempotence)
BA
Negation Normal Form
• Literals: Atomic Sentences or negations thereof.
• Negation Normal Form: An expression built up with ‘’,
‘’, and literals.
• Using repeated DeMorgan and Double Negation, we can
transform any truth-functional expression built up with ‘’,
‘’, and ‘’ into an expression that is in Negation Normal
Form.
• Example:
Disjunctive Normal Form
• Disjunctive Normal Form: A disjunction of conjunctions of
literals.
• Using repeated distribution of  over , any statement in
Negation Normal Form can be written in Disjunctive Normal
Form.
• Example:
Truth-Functional Connectives
• So far, we have seen one unary truth-functional connective
(‘’), and two binary truth-functional connectives (‘’, ‘’).
• Later, we will see two more binary connectives (‘’, ‘’)
• However, there are many more truth-functional connectives
possible:
– First of all, a connective can take any number of arguments: 3 (ternary),
4, 5, etc.
– Second, there are unary and binary connectives other than the ones
listed above.
Truth-Functional Expressive
Completeness
• Since I can express any truth function using ‘’, ‘’, and ‘’, we say
that the set of operators {, , } is (truth-functionally) expressively
complete.
• DeMorgan Laws:
– (P  Q)  P  Q
– (P  Q)  P  Q
• Hence, by the principle of substitution of logical equivalents, since
{, , } is expressively complete, the sets {, } and {, } are
expressively complete as well!
The Material Conditional
• Let us define the binary truth-functional connective ‘’
according to the truth-table below.
• The expression PQ is called a conditional. In here, P is the
antecedent, and Q the consequent.
‘If … then …’ Statements

• The conditional is used to capture ‘if … then …’


statements.
• Although the match isn’t perfect, most uses of ‘if …
then …’ are captured fine with the conditional.
• In particular, any ‘if … then …’ statement will be
false if the ‘if’ part is true, but the ‘then’ part false,
and the conditional captures this important truth-
functional aspect of any ‘if … then …’ statement.
‘If and only if’ and the
Material Biconditional
A statement of the form ‘P if and only if Q’ (or ‘P iff Q’) is short
for ‘if P then Q, and if Q then P’. Hence, we could translate this
as (PQ)  (QP). However, since this is a common
expression, we define a new connective ‘’:
Some Important Equivalences
• Implication:
• P  Q  P  Q
• (P  Q)  P  Q
• Transposition:
• P  Q  Q  P
• Exportation:
• P  (Q  R)  (P  Q)  R
• Equivalence:
• P  Q  (P  Q)  (Q  P)
• P  Q  (P  Q)  (P  Q)
Quantifiers
• A quantifier is “an operator that limits the variables of a
proposition”

• Two types:
– Universal
– Existential
Universal quantifiers 1
• Represented by an upside-down A: 
– It means “for all”
– Let P(x) = x+1 > x

• We can state the following:


– x P(x)
– English translation: “for all values of x, P(x) is true”
– English translation: “for all values of x, x+1>x is true”
Universal quantifiers 2
• But is that always true?
– x P(x)
• Let x = the character ‘a’
– Is ‘a’+1 > ‘a’?
• Let x = the state of Virginia
– Is Virginia+1 > Virginia?
• You need to specify your universe!
– What values x can represent
– Called the “domain” or “universe of discourse” by the
textbook
Universal quantifiers 3
• Let the universe be the real numbers.
– Then, x P(x) is true

• Let P(x) = x/2 < x


– Not true for the negative numbers!
– Thus, x P(x) is false
• When the domain is all the real numbers

• In order to prove that a universal quantification is true, it


must be shown for ALL cases
• In order to prove that a universal quantification is false, it
must be shown to be false for only ONE case
Universal quantification 4
• Given some propositional function P(x)

• And values in the universe x1 .. xn

• The universal quantification x P(x) implies:

P(x1)  P(x2)  …  P(xn)


Universal quantification 5
• Think of  as a for loop:

• x P(x), where 1 ≤ x ≤ 10

• … can be translated as …

for ( x = 1; x <= 10; x++ )


is P(x) true?

• If P(x) is true for all parts of the for loop, then x P(x)
– Consequently, if P(x) is false for any one value of the for loop, then x P(x)
is false
Existential quantification 1
• Represented by an bacwards E: 
– It means “there exists”
– Let P(x) = x+1 > x

• We can state the following:


– x P(x)
– English translation: “there exists (a value of) x such that P(x)
is true”
– English translation: “for at least one value of x, x+1>x is true”
Existential quantification 2
• Note that you still have to specify your universe
– If the universe we are talking about is all the states in the
US, then x P(x) is not true

• Let P(x) = x+1 < x


– There is no numerical value x for which x+1<x
– Thus, x P(x) is false
Existential quantification 3
• Let P(x) = x+1 > x
– There is a numerical value for which x+1>x
• In fact, it’s true for all of the values of x!
– Thus, x P(x) is true

• In order to show an existential quantification is true, you only


have to find ONE value
• In order to show an existential quantification is false, you have
to show it’s false for ALL values
Existential quantification 4
• Given some propositional function P(x)

• And values in the universe x1 .. xn

• The existential quantification x P(x) implies:

P(x1)  P(x2)  …  P(xn)


A note on quantifiers
• Recall that P(x) is a propositional function
– Let P(x) be “x == 0”
• Recall that a proposition is a statement that is either true or
false
– P(x) is not a proposition
• There are two ways to make a propositional function into a
proposition:
– Supply it with a value
• For example, P(5) is false, P(0) is true
– Provide a quantifiaction
• For example, x P(x) is false and x P(x) is true
– Let the universe of discourse be the real numbers
Mathematical Induction
A method of proof

It does not generate answers:


it only can prove them

Three parts:
 Base case(s): show it is true
for one element

 Inductive hypothesis: assume


it is true for any given element

Must be clearly labeled!!!


 Show that if it true for the next
highest element
Induction example
• Show that the sum of the first n odd integers is n2
• Example: If n = 5, 1+3+5+7+9 = 25 = 52
• Formally, Show n
n P(n) where P(n)   2i  1
i 1
 n 2

• Base case: Show that P(1) is true


1
P(1)   2(
i 1
i )  1  12

 1  1
Induction example, continued
• Inductive hypothesis: assume true for k
• Thus, we assume that P(k) is true, or that
k

 2i
i 1
 1  k 2

• Note: we don’t yet know if this is true or not!

• Inductive step: show true for k+1


• We want to show that:
k 1

 2i
i 1
 1  ( k  1) 2
Induction example, continued
k
• Recall the inductive hypothesis:  2i
i 1
 1  k 2

• Proof of inductive step:


k 1

 2i
i 1
 1  ( k  1) 2

k
2(k  1)  1   2i  1  k 2  2k  1
i 1
2(k  1)  1  k 2  k 2  2k  1
k 2  2k  1  k 2  2k  1
What did we show
• Base case: P(1)
• If P(k) was true, then P(k+1) is true
• i.e., P(k) → P(k+1)

• We know it’s true for P(1)


• Because of P(k) → P(k+1), if it’s true for P(1), then it’s true for P(2)
• Because of P(k) → P(k+1), if it’s true for P(2), then it’s true for P(3)
• Because of P(k) → P(k+1), if it’s true for P(3), then it’s true for P(4)
• Because of P(k) → P(k+1), if it’s true for P(4), then it’s true for P(5)
• And onwards to infinity

• Thus, it is true for all possible values of n

• In other words, we showed that: P(1)  k P(k )  P(k  1)  n P(n)


The idea behind inductive proofs

• Show the base case

• Show the inductive hypothesis

• Manipulate the inductive step so that you can substitute in part of

the inductive hypothesis

• Show the inductive step


Second induction example
• Rosen, section 3.3, question 2:
• Show the sum of the first n positive even integers is n2 + n
• Rephrased: n
n P(n) where P(n)   2i  n 2  n
i 1
• The three parts:
• Base case
• Inductive hypothesis
• Inductive step
Second induction example,
continued
Base case: Show P(1): 1
P(1)   2(i)  12  1
i 1

 2  2
Inductive hypothesis: Assume
k
P(k )   2i  k 2  k
i 1

Inductive step: Show


k 1
P(k  1)   2i  (k  1) 2  (k  1)
i 1
Second induction example, continued
• Recall our inductive
hypothesis:
k
P(k )   2i  k 2  k
i 1
k 1


i
2i  ( k  1) 2
 k 1
k1
2(k  1)   2i  (k  1) 2  k  1
i 1
2(k  1)  k  k  (k  1) 2  k  1
2

k 2  3k  2  k 2  3k  2
Notes on proofs by induction
• We manipulate the k+1 case to make part of it look like the k case
• We then replace that part with the other side of the k case
k
P(k )   2i  k 2  k
i 1
k 1

 2
i
i
k1
 ( k  1) 2
 k 1
2(k  1)   2i  (k  1) 2  k  1
i 1

2(k  1)  k 2  k  (k  1) 2  k  1
k 2  3k  2  k 2  3k  2
Third induction example
• Rosen, question 7: Show n
n(n  1)( 2n  1)
i 1
2
i 
6
1
1(1  1)( 2  1)
• Base case: n = 1 
i 1
i 
2

6
6
1 
2

6
11
• Inductive hypothesis: assume
k
k (k  1)( 2k  1)

i 1
i 
2

6
Third induction example
• Inductive step: show
k 1
(k  1)(( k  1)  1)( 2(k  1)  1)

i 1
i 2

6
k 1
(k  1)(( k  1)  1)( 2(k  1)  1)

i 1
i 2

6
k
(k  1)( k  2)( 2k  3)
(k  1)   i 
2 2

i 1 6
k (k  1)( 2k  1) (k  1)( k  2)( 2k  3)
(k  1) 
2

6 6
6(k  1) 2  k (k  1)(2k  1)  (k  1)(k  2)(2k  3)
2k 3  9k 2  13k  6  2k 3  9k 2  13k  6
k
k (k  1)( 2k  1)

i 1
i 
2

6
Third induction again: what if your inductive
hypothesis was wrong?
• Show: n
n(n  1)( 2n  2)

i 1
i 
2

6 1
1(1  1)( 2  2)
• Base case: n = 1:  
i 2

i 1 6
7
12 
6
7
1
6

• But let’s continue anyway…


• Inductive hypothesis: assume
k
k (k  1)( 2k  2)

i 1
i 
2

6
Third induction again: what if your inductive
hypothesis was wrong?
• Inductive step: show k 1
(k  1)(( k  1)  1)( 2(k  1)  2)

i 1
i 
2

6
k 1
(k  1)(( k  1)  1)( 2(k  1)  2)

i 1
i 
2

6
k
(k  1)( k  2)( 2k  4)
(k  1) 2   i 2 
i 1 6
k (k  1)( 2k  2) (k  1)( k  2)( 2k  4)
(k  1) 
2

6 6
6(k  1) 2  k (k  1)(2k  2)  (k  1)(k  2)(2k  4)
k
k (k  1)( 2k  2)
2k 3  10k 2  14k  6  2k 3  10k 2  16k  8

i 1
i 2

6
Fourth induction example
• Rosen, question 14: show that n! < nn for all n > 1
• Base case: n = 2
2! < 22
2<4
• Inductive hypothesis: assume k! < kk
• Inductive step: show that (k+1)! < (k+1)k+1

( k  1)!  (k  1)k!  (k  1)k k  (k  1)( k  1) k  (k  1) k 1


Strong induction
• Weak mathematical induction assumes P(k) is true, and uses that
(and only that!) to show P(k+1) is true

• Strong mathematical induction assumes P(1), P(2), …, P(k) are all true,
and uses that to show that P(k+1) is true.

P(1)  P(2)  P(3)  ...  P(k )  P(k 1)


Strong induction example 1
• Show that any number > 1 can be written as the product of primes

• Base case: P(2)


• 2 is the product of 2 (remember that 1 is not prime!)
• Inductive hypothesis: P(1), P(2), P(3), …, P(k) are all true
• Inductive step: Show that P(k+1) is true
Strong induction example 1
• Inductive step: Show that P(k+1) is true
• There are two cases:
• k+1 is prime
• It can then be written as the product of k+1
• k+1 is composite
• It can be written as the product of two composites, a and b, where 2
≤ a ≤ b < k+1
• By the inductive hypothesis, both P(a) and P(b) are true

S-ar putea să vă placă și