Professional Documents
Culture Documents
Is this a statement?
The Statement/Proposition Game
Is this a statement?
The Statement/Proposition Game
Is this a statement?
The Statement/Proposition Game
”y > 5”
Is this a statement?
The Statement/Proposition Game
”y > 5”
”y > 5”
Is this a statement?
The Statement/Proposition Game
Is this a statement? no
It’s a request
Is this a proposition?
The Statement/Proposition Game
Is this a statement? no
It’s a request
Is this a proposition? no
Only statements can be propositions
The Statement/Proposition Game
Is this a statement?
The Statement/Proposition Game
Is this a statement? no
It’s a question
Is this a proposition?
The Statement/Proposition Game
Is this a statement? no
It’s a question
Is this a proposition? no
Only statements can be propositions.
The Statement/Proposition Game
Is this a statement?
The Statement/Proposition Game
Is this a statement?
The Statement/Proposition Game
Is this a statement?
The Statement/Proposition Game
Definition
Let p be a proposition. The negation of p, denoted
by ¬p (also denoted by p ), is the statement:
”It is not the case that p.”
The proposition ¬p is read ”not p.” The truth value
of the negation of p, ¬p, is the opposite of the
truth value of p.
Example
Find the negation of the proposition ”Michael’s PC
runs on Linux” and express this in simple English.
Example
Find the negation of the proposition ”Michael’s PC
runs on Linux” and express this in simple English.
Solution
The negation is
Solution
The negation is
Solution
The negation is
”It is not the case that Vandana’s smartphone has at least 32GB of
memory”.
Propositional Logic
Example
Find the negation of the proposition ”Vandana’s smartphone has at
least 32GB memory” and express this in simple English.
Solution
The negation is
”It is not the case that Vandana’s smartphone has at least 32GB of
memory”.
P ¬P
true (T) false (F)
P Q P∧Q
T T T
T F F
F T F
F F F
Table 2: Truth Table for the Conjunction Operator
Disjunction (OR)
P Q P∨Q
T T T
T F T
F T T
F F F
Table 3: Truth Table for the Disjunction Operator
Exclusive-OR (XOR)
P Q P⊕Q
T T F
T F T
F T T
F F F
Table 4: Truth Table for the Exclusive-OR Operator
Implication (If- then)
P Q P→Q
T T T
T F F
F T T
F F T
Table 5: Truth Table for the Implication Operator
Biconditional (If and only if)
P Q P↔Q
T T T
T F F
F T F
F F T
Table 6: Truth Table for the Biconditional Operator
Statement and Operators
P Q ¬P ¬Q (¬P) ∨ (¬Q)
T T F F F
T F F T T
F T T F T
F F T T T
Table 7: Truth Table for Statements and Operators
Statement and Operations
Operator Precedence
¬ 1
∧ 2
∨ 3
→ 4
↔ 5
x+y =z
x+y =z
x+y =z
x+y =z
x+y =z
x+y =z
x+y =z
x+y =z
Solution
”For every ”x” there exists a ”y” so that ”x + y = 320”
Is it true?
Quantification
Another example
Example
Let the universe of discourse be the real KNUST’ers.
What does ∀ x ∃ y (x + y = 320) mean ?
Solution
”For every ”x” there exists a ”y” so that ”x + y = 320”
Is it true? yes
Is it true for the natural KNUST’ers?
Quantification
Another example
Example
Let the universe of discourse be the real KNUST’ers.
What does ∀ x ∃ y (x + y = 320) mean ?
Solution
”For every ”x” there exists a ”y” so that ”x + y = 320”
Is it true? yes
Is it true for the natural KNUST’ers? no
Disproof by Counterexample
A counterexample to ∀ x P(x ) is an object c so that P(c) is
false.
Solution
¬∀ x (Rose(x ) → Red(x ))
Negation
Example
Not all roses are red
Solution
¬∀ x (Rose(x ) → Red(x ))
∃ x (Rose(x ) ∧ ¬Red(x ))
Nobody is perfect
Solution
¬∃ x (Person(x ) ∧ Perfect (x ))
Negation
Example
Not all roses are red
Solution
¬∀ x (Rose(x ) → Red(x ))
∃ x (Rose(x ) ∧ ¬Red(x ))
Nobody is perfect
Solution
¬∃ x (Person(x ) ∧ Perfect (x ))
∀ x (Person(x ) → ¬Perfect (x ))
Nested Quantifier
A predicate can have more than one variable.
• S(x , y , z) : z is the sum of x and y.
Nested Quantifier
A predicate can have more than one variable.
• S(x , y , z) : z is the sum of x and y.
• F (x , y ) : x and y are friends.
Nested Quantifier
A predicate can have more than one variable.
• S(x , y , z) : z is the sum of x and y.
• F (x , y ) : x and y are friends.
Nested Quantifier
A predicate can have more than one variable.
• S(x , y , z) : z is the sum of x and y.
• F (x , y ) : x and y are friends.
p→q
q→r Hypothetical syllogism
∴p→r
Arguments
Example
• Kofi is either intelligent or a good actor.
Arguments
Example
• Kofi is either intelligent or a good actor.
• If Kofi is intelligent, then he can count from 1 to 10.
Arguments
Example
• Kofi is either intelligent or a good actor.
• If Kofi is intelligent, then he can count from 1 to 10.
• Kofi can count from 1 to 3.
Arguments
Example
• Kofi is either intelligent or a good actor.
• If Kofi is intelligent, then he can count from 1 to 10.
• Kofi can count from 1 to 3.
• Therefore, Kofi is a good actor.
Arguments
Example
• Kofi is either intelligent or a good actor.
• If Kofi is intelligent, then he can count from 1 to 10.
• Kofi can count from 1 to 3.
• Therefore, Kofi is a good actor.
Arguments
Example
• Kofi is either intelligent or a good actor.
• If Kofi is intelligent, then he can count from 1 to 10.
• Kofi can count from 1 to 3.
• Therefore, Kofi is a good actor.
∀x P(x )
Universal instantiation
∴ P(c) if c ∈ U
∃ xP(x )
Existential instantiation
∴ P(c) for some element c ∈ U
∀ x P(x )
Universal instantiation
∴ P(c) if c ∈ U
Proving Theorems
Direct Proof:
An implication p → q can be proved by showing that if p is
true, then q is also true.
Proving Theorems
Direct Proof:
An implication p → q can be proved by showing that if p is
true, then q is also true.
Example
Give a direct proof of the theorem ”if n is odd, then n2 is odd”
Idea: Assume that the hypothetical of this implication is
true (n is odd). Then use rules of inference and known
theorems of math to show that q must also be true (n2 is
odd)
Proving Theorems
n is odd
Then n = 2k + 1, where k is an integer
Proving Theorems
n is odd
Then n = 2k + 1, where k is an integer
Consequently:
n2 = (2k + 1)2
= 4k2 + 4k + 1
= 2(2k2 + 2k) + 1
• Indirect Proof:
Proving Theorems
• Indirect Proof:
• An implication p → q is equivalent to its contrapositive
¬q → ¬p. Therefore we can prove p → q by showing that
whenever q is false, then p is also false.
Proving Theorems
• Indirect Proof:
• An implication p → q is equivalent to its contrapositive
¬q → ¬p. Therefore we can prove p → q by showing that
whenever q is false, then p is also false.
Proving Theorems
• Indirect Proof:
• An implication p → q is equivalent to its contrapositive
¬q → ¬p. Therefore we can prove p → q by showing that
whenever q is false, then p is also false.
Example
Give an indirect proof of the theorem ”if 3n + 2 is odd, then n is
odd
Idea: Assume that the conclusion of this implication is false
(n is even). Then use rules of inference and known theorems
to show that p must be also false (3n + 2 is even)
Proving Theorems
n is even.
Proving Theorems
n is even.
Then n = 2k, where k is an integer.
Proving Theorems
n is even.
Then n = 2k, where k is an integer.
It follows that:
3n + 2 = 3(2k) + 2
= 6k + 2
= 2(3k + 1)
Therefore, 3n + 2 is even
We have shown the contrapositive of the implication is true,
so the implication itself true also.
(If 3n + 2 is odd, then n is odd)
Proving Theorems
Indirect Proof is a special case of proof by contradiction
Suppose n is even (negation of the conclusion)
Then n = 2k, where k is an integer:
It follows that:
3n + 2 = 3(2k) + 2
= 6k + 2
= 2(3k + 1)
Therefore, 3n + 2 is even
However, this is a contradiction since 3n + 2 is given to be
odd, so the conclusion (n is odd) holds.
Proving Theorems
Example
Anyone performs well is either intelligent or a good actor.
Proving Theorems
Example
Anyone performs well is either intelligent or a good actor.