Professional Documents
Culture Documents
Informal proofs
Lecture 4
Course administration
Homework 1
• First homework assignment is out today will be posted on
the course web page
• Due next week on Thurday
Recitations:
• today at 4:00pm SENSQ 5313
• tomorrow at 11:00 SENSQ 5313
1
CS 441 Discrete Mathematics for CS
Lecture 6
Informal proofs
Milos Hauskrecht
milos@cs.pitt.edu
5329 Sennott Square
Proofs
• The truth value of some statements about the world are obvious
and easy to assess
• The truth of other statements may not be obvious, …
…. But it may still follow (be derived) from known facts about
the world
Proof: shows that the truth value of such a statement follows from
(or can be inferred) from the truth value of other statements
Important questions:
– When is the argument correct?
– How to construct a correct argument, what method to use?
1
Informal proofs
Proving theorems in practice:
• The steps of the proofs are not expressed in any formal language
as e.g. propositional logic
• Steps are argued less formally using English, mathematical
formulas and so on
• One must always watch the consistency of the argument made,
logic and its rules can often help us to decide the soundness of the
argument if it is in question
4
Informal proofs
Proving theorems in practice:
• The steps of the proofs are not expressed in any formal language
as e.g. propositional logic
• Steps are argued less formally using English, mathematical
formulas and so on
• One must always watch the consistency of the argument made,
logic and its rules can often help us to decide the soundness of the
argument if it is in question
4
Direct proof
• p q is proved by showing that if p is true then q follows
Proof:
• Assume the hypothesis is true, i.e. suppose n is odd.
• Then n = 2k + 1, where k is an integer.
n2 = (2k + 1)2
= 4k2 + 4k + 1
= 2(2k2 + 2k) + 1
• Therefore, n2 is odd.
Indirect proof
• To show p q prove its contrapositive ¬q ¬p
• Why? p q and ¬q ¬p are equivalent !!!
• Assume ¬q is true, show that ¬p is true.
5
Direct proof
• p q is proved by showing that if p is true then q follows
Proof:
• Assume the hypothesis is true, i.e. suppose n is odd.
• Then n = 2k + 1, where k is an integer.
n2 = (2k + 1)2
= 4k2 + 4k + 1
= 2(2k2 + 2k) + 1
• Therefore, n2 is odd.
Indirect proof
• To show p q prove its contrapositive ¬q ¬p
• Why? p q and ¬q ¬p are equivalent !!!
• Assume ¬q is true, show that ¬p is true.
5
Proof by contradiction
• We want to prove p q
• The only way to reject (or disprove) p q is to show that (p
¬q ) can be true
Proof by contradiction
• We want to prove p q
• To reject p q show that (p ¬q ) can be true
• To reject (p ¬q ) show that either q or ¬ p is True
6
Proof by contradiction
• We want to prove p q
• The only way to reject (or disprove) p q is to show that (p
¬q ) can be true
Proof by contradiction
• We want to prove p q
• To reject p q show that (p ¬q ) can be true
• To reject (p ¬q ) show that either q or ¬ p is True
6
Proof by contradiction
• We want to prove p q
• To reject p q show that (p ¬q ) can be true
• To reject (p ¬q ) show that either q or ¬ p is True
Vacuous proof
We want to show p q
• Suppose p (the hypothesis) is always false
• Then p q is always true.
Reason:
• F q is always T, whether q is True or False
Example:
• Let P(n) denotes “if n > 1 then n2> n” is TRUE.
• Show that P(0).
Proof:
• For n=0 the premise is False. Thus P(0) is always true.
7
Proof by contradiction
• We want to prove p q
• To reject p q show that (p ¬q ) can be true
• To reject (p ¬q ) show that either q or ¬ p is True
Vacuous proof
We want to show p q
• Suppose p (the hypothesis) is always false
• Then p q is always true.
Reason:
• F q is always T, whether q is True or False
Example:
• Let P(n) denotes “if n > 1 then n2> n” is TRUE.
• Show that P(0).
Proof:
• For n=0 the premise is False. Thus P(0) is always true.
7
Trivial proofs
We want to show p q
• Suppose the conclusion q is always true
• Then the implication p q is trivially true.
• Reason:
• p T is always T, whether p is True or False
Example:
• Let P(n) is “if a >=b then an >= bn ”
• Show that P(0)
Proof:
a0 >=b0 is 1=1 trivially true.
Proof by cases
• We want to show p1 p2 … pn q
• Note that this is equivalent to
– (p1 q) (p2 q) … (pn q)
• Why?
• p1 p2 … pn q <=> (useful)
• ¬ (p1 p2 … pn) q <=> (De Morgan)
• (¬p1 ¬p2 … ¬pn) q <=> (distributive)
• (¬p1 q) (¬p2 q) … (¬pn q) <=> (useful)
• (p1 q) (p2 q) … (pn q)
8
Trivial proofs
We want to show p q
• Suppose the conclusion q is always true
• Then the implication p q is trivially true.
• Reason:
• p T is always T, whether p is True or False
Example:
• Let P(n) is “if a >=b then an >= bn ”
• Show that P(0)
Proof:
a0 >=b0 is 1=1 trivially true.
Proof by cases
• We want to show p1 p2 … pn q
• Note that this is equivalent to
– (p1 q) (p2 q) … (pn q)
• Why?
• p1 p2 … pn q <=> (useful)
• ¬ (p1 p2 … pn) q <=> (De Morgan)
• (¬p1 ¬p2 … ¬pn) q <=> (distributive)
• (¬p1 q) (¬p2 q) … (¬pn q) <=> (useful)
• (p1 q) (p2 q) … (pn q)
8
Proof by cases
We want to show p1 p2 … pn q
• Equivalent to (p1 q) (p2 q) … (pn q)
Prove individual cases as before. All of them must be true.
Proof by cases
We want to show p1 p2 … pn q
• Equivalent to (p1 q) (p2 q) … (pn q)
Prove individual cases as before. All of them must be true.
9
Proof by cases
We want to show p1 p2 … pn q
• Equivalent to (p1 q) (p2 q) … (pn q)
Prove individual cases as before. All of them must be true.
Proof by cases
We want to show p1 p2 … pn q
• Equivalent to (p1 q) (p2 q) … (pn q)
Prove individual cases as before. All of them must be true.
9
Proof of equivalences
We want to prove p q
• Statements: p if and only if q.
• Note that p q is equivalent to [ (p q ) (q p) ]
• Both implications must hold.
Example:
• Integer is odd if and only if n^2 is odd.
Proof of (p q ) :
• (p q ) If n is odd then n^2 is odd
• we use a direct proof
• Suppose n is odd. Then n = 2k + 1,where k is an integer.
• n^2 = (2k + 1)^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1
• Therefore, n^2 is odd.
CS 441 Discrete mathematics for CS M. Hauskrecht
Proof of equivalences
We want to prove p q
• Note that p q is equivalent to [ (p q ) (q p) ]
• Both implications must hold.
10
Proof of equivalences
We want to prove p q
• Statements: p if and only if q.
• Note that p q is equivalent to [ (p q ) (q p) ]
• Both implications must hold.
Example:
• Integer is odd if and only if n^2 is odd.
Proof of (p q ) :
• (p q ) If n is odd then n^2 is odd
• we use a direct proof
• Suppose n is odd. Then n = 2k + 1,where k is an integer.
• n^2 = (2k + 1)^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1
• Therefore, n^2 is odd.
CS 441 Discrete mathematics for CS M. Hauskrecht
Proof of equivalences
We want to prove p q
• Note that p q is equivalent to [ (p q ) (q p) ]
• Both implications must hold.
10
Proofs with quantifiers
• Existence proof – sentences expressed with an existential
quantifiers
– Constructive
• Find an example (through search) that shows the
statement holds.
– Nonconstructive
• Show the statement holds for one example but we do not
have the witness example. Typically relies on the proof by
contradiction – negate the existentially quantified
statement and show that it implies a contradiction.
– Counterexamples:
• use to disprove universal statements
• Similar to constructive proofs for existentially
11
Proofs with quantifiers
• Existence proof – sentences expressed with an existential
quantifiers
– Constructive
• Find an example (through search) that shows the
statement holds.
– Nonconstructive
• Show the statement holds for one example but we do not
have the witness example. Typically relies on the proof by
contradiction – negate the existentially quantified
statement and show that it implies a contradiction.
– Counterexamples:
• use to disprove universal statements
• Similar to constructive proofs for existentially
11
Mathematical Induction
Discrete Mathematics
1
What is induction?
A method of proof
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
2
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
n
Formally, Show n P(n) whereP(n) =
◼
2i − 1 == n 2
i =1
= 1 == 1
3
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
2i
i =1
− 1 == ( k + 1) 2
4
Induction example, continued
k
Recall the inductive hypothesis: 2i − 1 == k 2
i =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
5
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)
7
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) whereP(n) = 2i == n + n
2
i =1
8
Second induction example,
continued
Base case: Show P(1): 1
P(1) = 2(i) == 12 + 1
i =1
= 2 == 2
9
Second induction example,
continued
Recall our k inductive
P(k ) = 2i == k + k
2
hypothesis: i =1
k +1
2i
i =1
== ( k + 1) 2
+ k +1
k
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
10
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
k +1 P(k ) = 2i == k 2 + k
2i
i =1
== ( k + 1) 2
+ k +1 i =1
k
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 11
Third induction example
Rosen, question 7: Show n
n(n + 1)(2n + 1)
i =1
i =
2
Base case: n = 1 1
1(1 + 1)(2 + 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 12
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)
k (k + 1)(2k + 1)
k
2k + 9k + 13k + 6 = 2k + 9k + 13k + 6 i =
3 2 3 2 2
i =1 6 13
Third induction again: what if your
inductive hypothesis was wrong?
Show: i 2 = n(n + 1)(2n + 2)
n
i =1 6 1
1(1 + 1)(2 + 2)
Base case: n = 1:
=
i 2
i =1 6
7
1 =
2
6
7
1
6
But let’s continue anyway…
Inductive hypothesis: assume
k
k (k + 1)(2k + 2)
i =1
i =
2
6 14
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) + i =
2 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 + 1)(2k + 2)
k
2k + 10k + 14k + 6 2k + 10k + 16k + 8 i =
3 2 3 2 2
i =1 6 15
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 + 1)k! (k + 1)k (k + 1)( k + 1) = (k + 1)
k k
16
Question 40
Take a pile of n stones
◼ Split the pile into two smaller piles of size r
and s
◼ Repeat until you have n piles of 1 stone each
Take the product of all the splits
◼ So all the r’s and s’s from each split
Sum up each of these products
Prove that this product equals n(n − 1)
2
17
Question 40
10
7 21 3
4 12 3 2 2 1
2 4 2 2 2 1 1 1 1
1 1 1 1 1 1 1 1 1
n(n − 1)
2
10 * 9
21 + 12 + 2 + 4 + 2 + 1 + 1 + 1 + 1 = 45 =
2 18
Question 40
We will show it is true for a pile of k
stones, and show it is true for k+1 stones
◼ So P(k) means that it is true for k stones
Base case: n = 1
◼ No splits necessary, so the sum of the
products = 0
◼ 1*(1-1)/2 = 0
◼ Base case proven
19
Question 40
Inductive hypothesis: assume that P(1), P(2), …,
P(k) are all true
◼ This is strong induction!
20
Question 40
◼ Thus, we want to show that i2 − i
(i)*(k+1-i) + P(i) + P(k+1-i) = P(k+1) P( i ) =
2
(k + 1 − i )( k + 1 − i − 1) k 2 + k − 2ki − i + i 2
P( k + 1 − i ) = =
2 2
(k + 1)( k + 1 − 1) k 2 + k
P( k + 1) = =
2 2
(i) * (k + 1 − i) + P(i) + P(k + 1 − i) = P(k + 1)
i 2
− i k 2
+ k − 2 ki − i − i 2
k 2
+k
ki + i − i 2 + + =
2 2 2
2ki + 2i − 2i 2 + i 2 − i + k 2 + k − 2ki − i + i 2 = k 2 + k
k2 + k = k2 + k 21