Download presentation
Presentation is loading. Please wait.
Published byPierce Wade Modified over 9 years ago
1
1 Proof Strategies CS/APMA 202 Rosen section 3.1 Aaron Bloomfield
2
2 Proof Strategies: What’s Important Forward and backward reasoning Leveraging proof by cases Adapting existing proofs Conjecture and proof Conjecture and counterexamples Open problems: 3x + 1 The halting problem
3
3 Forward reasoning One example: modus ponens / direct proof Given an antecedent p and a implication p→q Show that conclusion q is true Show that conclusion q is true Often hard to see where the proof should lead In that case, do a backward reasoning to determine the forward reasoning In that case, do a backward reasoning to determine the forward reasoning
4
4 Backward reasoning Start with the conclusion of the theorem Find an antecedent that yields the given conclusion In other words, given conclusion q and implication p→q, find an antecedent p that allows the conditional to be true Will often only be one such antecedent Will often only be one such antecedent
5
5 Backward reasoning Is not the same as modus badus! Modus badus: Given p→q and q, show p via the converse q→p Given p→q and q, show p via the converse q→p Backward reasoning Given p→q and q, find a p that p→q is true Given p→q and q, find a p that p→q is true Or show that no such p can exist It can be any p! It can be any p!
6
6 Backward reasoning Is not the same as modus tonens! Modus tonens: Given p→q and ¬q, show ¬p via the contrapositive ¬q→¬p Given p→q and ¬q, show ¬p via the contrapositive ¬q→¬p Backward reasoning Given p→q and q, find a p that p→q is true Given p→q and q, find a p that p→q is true Or show that no such p can exist It can be any p! It can be any p!
7
0 0 0 ? 0 ? 0 0 1 0 0 1 1 0 0 What to prove? 14. Suppose five ones and four zeros are arranged around a circle. Between any two equal bits you insert a 0 and between any two unequal bits you insert a 1 to produce nine new bits. Then you erase the nine original bits. Show that when you iterate this procedure you can never get nine zeros. (Hint: work backwards.) 1 0 1 1 1 1 0 0 0 Backward reasoning
8
8 In order to create 9 0’s, the previous step had to have all 0’s or all 1’s Consider two cases for the second-to-last step: There were 9 0’s There were 9 0’s The only previous step for this case is 9 0’s (this case) or 9 1’s (other case) There can’t be any other ways to get 9 0’s There can’t be any other ways to get 9 0’s There were 9 1’s There were 9 1’s Then every bit needed to be different than the bit next to it Not possible with an odd number of bits! Not possible with an odd number of bits!
9
9 Forwards vs. Backwards reasoning Example 1 (Rosen, p. 215): Prove that when a≠b, a>0, and b>0
10
10 Forwards vs. Backwards reasoning Backwards reasoning: Because (a-b) 2 >0 when a≠b, it follows that the inequality is true Because (a-b) 2 >0 when a≠b, it follows that the inequality is true Forwards reasoning: Given, we can show that is equivalent to (a-b) 2 >0 Given, we can show that is equivalent to (a-b) 2 >0 (a-b) 2 >0 is always true when a≠b (a-b) 2 >0 is always true when a≠b
11
11 Leveraging proof by cases “When there is no obvious way to begin a proof, but when extra information in each case helps move the proof forward” Try to reduce the number of cases What to avoid Make sure you get ALL the cases Make sure you get ALL the cases
12
Cases 32. Prove that n/2 * n/2 = n 2 /4 for all integer n. Consider two cases: Even(n): easy Let n = 2k+1 (2k+1)/2 * (2k+1)/2 = (2k+1) 2 /4 k+½ * k+½ = (4k 2 +4k+1)/4 (k)*(k+1) = k 2 +k+¼ k 2 +k = k 2 +k+¼ k 2 +k = k 2 +k Odd(n): trickier Odd(n): trickier
13
13 Quick survey How are we doing so far? How are we doing so far? a) Very well b) With some review, I’ll be good c) Not really d) Not at all
14
14 An optical illusion
15
15 Another optical illusion
16
16 Definitions Theorem: a statement that can be shown to be true Or something that is widely believed to be true Or something that is widely believed to be true Conjecture: a statement whose truth value is unknown
17
17 Conjecture and counterexamples You can prove an existential quantifier by an example You can disprove an universal quantifier by example You cannot prove an universal quantifier by example You cannot disprove an existential quantifier by example
18
18 Proof by counterexample 15. Prove or disprove that n 2 -79n+1601 is a prime whenever n is a positive integer How to disprove? Find a single example that shows this to be false Find a single example that shows this to be false Let n = 1601 Let n = 1601 Then n 2 = (1601) 2 -79(1601)+1601 = 1523*1601 Then n 2 = (1601) 2 -79(1601)+1601 = 1523*1601
19
19 End of lecture on 15 March 2005
20
Proof by example What to prove? p Z (p > 0 prime(p) prime(p+2) prime(p+4) ) Or: p Z + (prime(p) prime(p+2) prime(p+4) ) 25. Prove or disprove that there are three consecutive odd positive integers that are primes, that is, odd primes of the form p, p+2, p+4. Constructive existence proof: 3, 5, 7
21
Proof by example 47.Prove that if you have an eight gallon jug of water and two empty jugs with capacities of five gallons and three gallons, then you can measure four gallons by successively pouring some of or all of the water in a jug into another jug. Show that there exists a sequence of steps that yields 4 gallons in one of the jugs Constructive proof: (8,0,0) (3,5,0) (3,2,3) (6,2,0) (6,0,2) (1,5,2) (1,4,3) 8, 5, 3
22
22 Open problems Fermat’s last theorem x n +y n =z n has no solutions in integers when xyz≠0 and n>2 x n +y n =z n has no solutions in integers when xyz≠0 and n>2 Finally proven! Finally proven! Goldbach’s Conjecture Every integer n (for n>2) is the sum of 2 primes Every integer n (for n>2) is the sum of 2 primes Shown for all n up to 4*10 14 Shown for all n up to 4*10 14 Thought to be true Thought to be true Twin prime conjecture There are an infinitely many number of primes that differ by 2 There are an infinitely many number of primes that differ by 2 Biggest twin prime: 318,032,361*2 107,001 ±1 Biggest twin prime: 318,032,361*2 107,001 ±1 That number has 32,220 digits! Thought to be true Thought to be true
23
23 Open problems 3x+1 conjecture Let f(x) return x/2 if x is even, and 3x+1 if x is odd Let f(x) return x/2 if x is even, and 3x+1 if x is odd Shown for all numbers up to 5.6*10 13 Shown for all numbers up to 5.6*10 13
24
24 The Halting problem Is it possible to write a function that will tell if any program will halt with any given input? Consider H(P,I) Returns “halts” or “loops forever” Returns “halts” or “loops forever” Note that P and I are both bit strings Now consider function K: function K (s) if H (s, s) = “loops forever” then halt elseloop forever We then call K(K)
25
25 The Halting problem Function K: function K (s) if H (s, s) = “loops forever” then halt elseloop forever We call K(K) Note that this calls H(K,K), which in turn calls K(K) Note that this calls H(K,K), which in turn calls K(K) If H(K,K) returns “halt”, then K loops forever If H(K,K) returns “halt”, then K loops forever But H(K,K) stated that K halts! If H(K,K) returns “loops forever”, then K halts If H(K,K) returns “loops forever”, then K halts But H(K,K) stated that K loops forever! Both cases reached contradictions
26
26 Adapting existing proofs Look at existing proofs To use as a “template” for your proofs To use as a “template” for your proofs To build upon for your proofs To build upon for your proofs
27
27 Reuse 49. Show that the problem of determining whether a program with a given input ever prints the digit 1 is unsolvable. Leverage off the halting problem, which is known to be unsolvable (undecidable).Leverage off the halting problem, which is known to be unsolvable (undecidable). Assume the ‘print 1’ statement occurs just before a halt statement.Assume the ‘print 1’ statement occurs just before a halt statement. Since we can’t know if program execution will ever reach the halt statement, we can’t know if it will reach the ‘print 1’ statement.Since we can’t know if program execution will ever reach the halt statement, we can’t know if it will reach the ‘print 1’ statement.
28
28 Quick survey I felt I understood the material in this slide set… I felt I understood the material in this slide set… a) Very well b) With some review, I’ll be good c) Not really d) Not at all
29
29 Quick survey The pace of the lecture for this slide set was… The pace of the lecture for this slide set was… a) Fast b) About right c) A little slow d) Too slow
30
30 Quick survey How interesting was the material in this slide set? Be honest! How interesting was the material in this slide set? Be honest! a) Wow! That was SOOOOOO cool! b) Somewhat interesting c) Rather borting d) Zzzzzzzzzzz
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.