1/17/2019
Tassos Dimitriou
CpE-203
Discrete Structures
Set 2
Prof. Tassos Dimitriou
Computer Engineering Department
Kuwait University
CpE-203: Discrete Structures 1
Tassos Dimitriou
Outline
Rules on Inference
Valid Arguments
Proof techniques
CpE-203: Discrete Structures 2
1
1/17/2019
Tassos Dimitriou
Rules of inference
Proofs: valid arguments that establish the truth of
mathematical statements
Argument: a sequence of statements that end with a conclusion
All but the final proposition are called premises.
The final proposition is called conclusion.
An argument is valid if the truth of all premises implies that the
conclusion is true.
To deduce new statements from statements we already have,
we use rules of inference
Like templates for constructing valid arguments.
CpE-203: Discrete Structures 3
Tassos Dimitriou
Valid Arguments
Assume you are given the following two statements:
“If you have a current password, then you can log onto the
network”
“You have a current password”
Therefore, “You can log onto the network”
pq
p
q
CpE-203: Discrete Structures 4
2
1/17/2019
Tassos Dimitriou
Modus Ponens (mode that affirms)
Consider (p (p→q)) → q
p q p→q p(p→q)) (p(p→q)) → q
T T T T T
T F F F T
F T T F T
F F T F T
p
pq
q
CpE-203: Discrete Structures 5
Tassos Dimitriou
Modus Ponens example
Assume you are given the following two statements:
“It is snowing today”
“If it snows today, then we will go skiing”
Let p = “It is snowing today”
Let q = “we will go skiing”
Then, by modus ponens, it follows that the conclusion of the
conditional statement, “We will go skiing,” is true.
CpE-203: Discrete Structures 6
3
1/17/2019
Tassos Dimitriou
Modus Ponens example (cont.)
Determine whether the argument given here is valid and
determine whether its conclusion must be true because of the
validity of the argument.
This argument is valid because it is constructed by using
modus ponens, a valid argument form.
However, one of its premises, 2 > 3/2 , is false.
Consequently, we cannot conclude that the conclusion is true.
(Also note that the conclusion is false)
CpE-203: Discrete Structures 7
Tassos Dimitriou
Modus Tollens
Assume that we know: ¬q and p → q
Recall that p → q ¬q → ¬p
Thus, we know ¬q and ¬q → ¬p
We can conclude ¬p
q
pq
p
CpE-203: Discrete Structures 8
4
1/17/2019
Tassos Dimitriou
Modus Tollens example
Assume you are given the following two statements:
“We will not go skiing”
“If it snows today, then we will go skiing”
Let p = “It is snowing today”
Let q = “we will go skiing”
Then, by modus tollens, it follows that the conclusion of the
conditional statement, “It does not snow today,” is true.
CpE-203: Discrete Structures 9
Tassos Dimitriou
Addition & Simplification
Addition: If you know that p is true, then p q will ALWAYS
be true
p
pq
Simplification: If p q is true, then p will ALWAYS be true
pq
p
CpE-203: Discrete Structures 10
5
1/17/2019
Tassos Dimitriou
Example Proof
We have the hypotheses:
“It is not sunny this afternoon and it is colder than yesterday”
“We will go swimming only if it is sunny”
“If we do not go swimming, then we will take a canoe trip”
“If we take a canoe trip, then we will be home by sunset”
Does this imply that “we will be home by sunset”?
When
p = “It is sunny this afternoon”
q = “it is colder than yesterday”
r = “We will go swimming”
s = “we will take a canoe trip”
t = “we will be home by sunset”
(( p q) (r p) ( r s) (s t)) t ???
CpE-203: Discrete Structures 11
Tassos Dimitriou
Example of proof
1. ¬p q 1st hypothesis
2. ¬p Simplification using step 1
3. r→p 2nd hypothesis
4. ¬r Modus tollens using steps 2 & 3
5. ¬r → s 3rd hypothesis
6. s Modus ponens using steps 4 & 5
7. s→t 4th hypothesis
8. t Modus ponens using steps 6 & 7
CpE-203: Discrete Structures 12
6
1/17/2019
Tassos Dimitriou
More Rules of Inference
Conjunction: if p and q are true separately, then pq is true
Disjunctive syllogism: If pq is true, and p is false, then q
must be true
Resolution: If pq is true, and ¬pr is true, then qr must
be true
Hypothetical syllogism: If p→q is true, and q→r is true,
then p→r must be true
CpE-203: Discrete Structures 13
Tassos Dimitriou
Summary: Rules of Inference
p q
Modus
pq Modus tollens pq
ponens
q p
pq pq
Hypothetical Disjunctive
qr p
syllogism syllogism
pr q
p pq
Addition Simplification
pq p
p pq
Conjunction q Resolution p r
pq qr
CpE-203: Discrete Structures 14
7
1/17/2019
Tassos Dimitriou
Example Proof
“If it does not rain or if it is not foggy, then the sailing race will
be held and the lifesaving demonstration will go on”
( r f) (s d)
“If the sailing race is held, then the trophy will be awarded”
st
“The trophy was not awarded”
t
Can you conclude: “It rained”?
CpE-203: Discrete Structures 15
Tassos Dimitriou
Example of proof
1. ¬t 3rd hypothesis
2. s→t 2nd hypothesis
3. ¬s Modus tollens using steps 2 & 3
4. (¬r¬f)→(sd) 1st hypothesis
5. ¬(sd)→¬(¬r¬f) Contrapositive of step 4
6. (¬s¬d)→(rf) DeMorgan’s law and double negation law
7. ¬s¬d Addition from step 3
8. rf Modus ponens using steps 6 & 7
9. r Simplification using step 8
CpE-203: Discrete Structures 16
8
1/17/2019
Tassos Dimitriou
Fallacies
Fallacies resemble rules of inference but are wrong.
Example 1: If you do every problem in this book, then you will
learn discrete mathematics. You learned discrete mathematics.
Therefore, you did every problem in this book.
((p → q) ∧ q) → p is not a tautology.
Called the fallacy of affirming the conclusion
Example 2: If you do every problem in this book, then you will
learn discrete mathematics. You didn’t do every problem in the
book. Therefore, you did not learn mathematics.
((p → q) ∧ ¬p)→¬q is not a tautology.
Called the fallacy of denying the hypothesis
CpE-203: Discrete Structures 17
Tassos Dimitriou
Rules of inference for the
Universal quantifier
Assume that we know that x P(x) is true
Then we can conclude that P(c) is true
Here c stands for some specific constant
This is called “universal instantiation”
Assume that we know that P(c) is true for any value of c
Then we can conclude that x P(x) is true
This is called “universal generalization”
CpE-203: Discrete Structures 18
9
1/17/2019
Tassos Dimitriou
Rules of inference for the existential
quantifier
Assume that we know that x P(x) is true
Then we can conclude that P(c) is true for some value of c
This is called “existential instantiation”
Assume that we know that P(c) is true for some value of c
Then we can conclude that x P(x) is true
This is called “existential generalization”
CpE-203: Discrete Structures 19
Tassos Dimitriou
CpE-203: Discrete Structures 20
10
1/17/2019
Tassos Dimitriou
Example of proof
Given the hypotheses:
“Linda, a student in this class, owns a red
convertible.” C(Linda)
R(Linda)
“Everybody who owns a red convertible has
gotten at least one speeding ticket”
x (R(x)→T(x))
Can you conclude: “Somebody in this class
x (C(x)T(x))
has gotten a speeding ticket”?
CpE-203: Discrete Structures 21
Tassos Dimitriou
Proofs
CpE-203: Discrete Structures 22
11
1/17/2019
Tassos Dimitriou
Terminology
Theorem: a statement that can be shown true. Sometimes
called facts.
Proposition: less important theorem
Proof: Demonstration that a theorem is true.
Axiom: A statement that is assumed to be true.
Lemma: a less important theorem that is useful to prove a
theorem.
Corollary: a theorem that can be proven directly from a
theorem that has been proved.
Conjecture: a statement that is being proposed to be a true
statement.
CpE-203: Discrete Structures 23
Tassos Dimitriou
Direct proofs
Consider an implication: p→q
If p is false, then the implication is always true
To perform a direct proof, assume that p is true, and show that q
must therefore be true
Show that the square of an even number is an even number
Rephrased: if n is even, then n2 is even
(Direct Proof) Assume n is even
Thus, n = 2k, for some k (definition of even numbers)
n2 = (2k)2 = 4k2 = 2(2k2)
As n2 is 2 times an integer, n2 is thus even
CpE-203: Discrete Structures 24
12
1/17/2019
Tassos Dimitriou
Indirect proofs
Consider an implication: p→q
It’s contrapositive is ¬q→¬p
This means that the conditional statement p → q can be
proved by showing that its contrapositive, ¬q →¬p, is true.
In a proof by contraposition of p → q, we take ¬q as a premise,
and using axioms, definitions, and previously proven theorems,
together with rules of inference, we show that ¬p must follow
CpE-203: Discrete Structures 25
Tassos Dimitriou
Indirect proof example
Prove that if n ≤ ab, where a and b are positive integers,
then a ≤√n or b ≤√n.
What is the contrapositive? Can you prove it?
When do you use a direct proof versus an indirect proof?
First evaluate whether a direct proof looks promising. Begin by
expanding the definitions in the hypotheses. Start to reason using
these hypotheses, together with axioms and available theorems.
If a direct proof does not seem to go anywhere, try the same
thing with a proof by contraposition.
CpE-203: Discrete Structures 26
13
1/17/2019
Tassos Dimitriou
Choosing between the two
Assume n is even, and show that n2 is even
n=2k for some integer k (definition of even numbers)
n2 = (2k)2 = 4k2 = 2(2k2)
As 2(2k2) is 2 times an integer, it is even
CpE-203: Discrete Structures 27
Tassos Dimitriou
Proof by contradiction
Given a statement p, assume it is false (i.e. assume ¬p)
Prove that ¬p cannot occur by arriving at some contradiction.
Therefore, p must be true.
Because a proof by contradiction does not prove a result
directly, it is another type of indirect proof
Other form: assume both p and ¬q are true. Then arrive at
contradiction: [(p → q) ¬q]→¬p is a tautology
CpE-203: Discrete Structures 28
14
1/17/2019
Tassos Dimitriou
Proof by contradiction example 1
Prove that for an integer n, if n2 is even, then n is even.
Assume conclusion is false that is n is odd. Since n is odd, we
can write n=2k+1. Taking square of both sides
n2=2(2k2+2k)+1=2m+1 implies n2 is odd, which contradicts the hypothesis
that n2 is even.
CpE-203: Discrete Structures 29
Tassos Dimitriou
Proofs of equivalences
This is showing the definition of a bi-conditional
Given a statement of the form “p if and only if q”
Show it is true by showing (p→q)(q→p) is true
This boils down to showing that p q and q p are both
true
CpE-203: Discrete Structures 30
15
1/17/2019
Tassos Dimitriou
Proofs of equivalence example
Show that m2=n2 if and only if m=n or m=-n
Rephrased: (m2=n2) ↔ [(m=n)(m=-n)]
[(m=n)(m=-n)] → (m2=n2)
Proof by cases!
Case 1: (m=n) → (m2=n2)
(m)2 = m2, and (n)2 = n2, so this case is proven
Case 2: (m=-n) → (m2=n2)
(m)2 = m2, and (-n)2 = n2, so this case is proven
(m2=n2) → [(m=n)(m=-n)]
Subtract n2 from both sides to get m2-n2=0
Factor to get (m+n)(m-n) = 0
Since that equals zero, one of the factors must be zero
Thus, either m+n=0 (which means m=-n)
Or m-n=0 (which means m=n)
CpE-203: Discrete Structures 31
Tassos Dimitriou
Mistakes in proofs
Many mistakes result from the introduction of steps that
do not logically follow from those that precede it.
What’s wrong with the following “proof” that 1 = 2? Let a, b be
two equal positive integers:
CpE-203: Discrete Structures 32
16
1/17/2019
Tassos Dimitriou
Another example
What is wrong with this “proof?”
“Theorem:” If n2 is positive, then n is positive.
“Proof:" Suppose that n2 is positive. Because the conditional
statement “If n is positive, then n2 is positive” is true, we can
conclude that n is positive.
CpE-203: Discrete Structures 33
Tassos Dimitriou
Counterexamples
Given a universally quantified statement, find a single
example which it is not true
Note that this is DISPROVING a UNIVERSAL statement by a
counterexample
x ¬R(x), where R(x) means “x has red hair”
Find one person (in the domain) who has red hair
Every positive integer is the square of another integer
The square root of 2 is2, which is not an integer…
CpE-203: Discrete Structures 34
17
1/17/2019
Tassos Dimitriou
CpE-203: Discrete Structures 35
18