Proof Strategies CSAPMA 202 Rosen section 3 1

  • Slides: 29
Download presentation
Proof Strategies CS/APMA 202 Rosen section 3. 1 Aaron Bloomfield 1

Proof Strategies CS/APMA 202 Rosen section 3. 1 Aaron Bloomfield 1

Proof Strategies: What’s Important Forward and backward reasoning Leveraging proof by cases Adapting existing

Proof Strategies: What’s Important Forward and backward reasoning Leveraging proof by cases Adapting existing proofs Conjecture and proof Conjecture and counterexamples Open problems: 3 x + 1 The halting problem 2

Forward reasoning One example: modus ponens / direct proof Given an antecedent p and

Forward reasoning One example: modus ponens / direct proof Given an antecedent p and a implication p→q n Show that conclusion q is true Often hard to see where the proof should lead n In that case, do a backward reasoning to determine the forward reasoning 3

Backward reasoning Start with the conclusion of theorem Find an antecedent that yields the

Backward reasoning Start with the conclusion of 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 n Will often only be one such antecedent 4

Backward reasoning Is not the same as modus badus! Modus badus: n Given p→q

Backward reasoning Is not the same as modus badus! Modus badus: n Given p→q and q, show p via the converse q→p Backward reasoning n Given p→q and q, find a p that p→q is true Or show that no such p can exist n It can be any p! 5

Backward reasoning Is not the same as modus tonens! Modus tonens: n Given p→q

Backward reasoning Is not the same as modus tonens! Modus tonens: n Given p→q and ¬q, show ¬p via the contrapositive ¬q→¬p Backward reasoning n Given p→q and q, find a p that p→q is true Or show that no such p can exist n It can be any p! 6

Backward reasoning 14. Suppose five ones and four zeros are arranged around a circle.

Backward reasoning 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. ) What to prove? 0 0 1 1 0 0 1 0 1 0 0 1 0 0 0 ? ?

Backward reasoning In order to create 9 0’s, the previous step had to have

Backward reasoning 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: n There were 9 0’s The only previous step for this case is 9 0’s (this case) or 9 1’s (other case) n n There can’t be any other ways to get 9 0’s There were 9 1’s Then every bit needed to be different than the bit next to it n Not possible with an odd number of bits! 8

Forwards vs. Backwards reasoning Example 1 (Rosen, p. 215): Prove that when a≠b, a>0,

Forwards vs. Backwards reasoning Example 1 (Rosen, p. 215): Prove that when a≠b, a>0, and b>0 9

Forwards vs. Backwards reasoning: n Because (a-b)2>0 when a≠b, it follows that the inequality

Forwards vs. Backwards reasoning: n Because (a-b)2>0 when a≠b, it follows that the inequality is true Forwards reasoning: n n Given , we can show that is equivalent to (a-b)2>0 is always true when a≠b 10

Leveraging proof by cases “When there is no obvious way to begin a proof,

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 n Make sure you get ALL the cases 11

Cases 32. Prove that n/2 * n/2 = n 2/4 for all integer n.

Cases 32. Prove that n/2 * n/2 = n 2/4 for all integer n. Consider two cases: Even(n): easy Odd(n): trickier Let n = 2 k+1 (2 k+1)/2 * (2 k+1)/2 = (2 k+1)2/4 k+½ * k+½ = (4 k 2+4 k+1)/4 (k)*(k+1) = k 2+k+¼ k 2+k = k 2+k

Quick survey n a) b) c) d) How are we doing so far? Very

Quick survey n a) b) c) d) How are we doing so far? Very well With some review, I’ll be good Not really Not at all 13

An optical illusion 14

An optical illusion 14

Another optical illusion 15

Another optical illusion 15

Definitions Theorem: a statement that can be shown to be true n Or something

Definitions Theorem: a statement that can be shown to be true n Or something that is widely believed to be true Conjecture: a statement whose truth value is unknown 16

Conjecture and counterexamples You can prove an existential quantifier by an example You can

Conjecture and counterexamples You can prove an existential quantifier by an example You can disprove an universal quantifier by example You cannot disprove an existential quantifier by example 17

Proof by counterexample 15. Prove or disprove that n 2 -79 n+1601 is a

Proof by counterexample 15. Prove or disprove that n 2 -79 n+1601 is a prime whenever n is a positive integer How to disprove? n n n Find a single example that shows this to be false Let n = 1601 Then n 2 = (1601)2 -79(1601)+1601 = 1523*1601 18

Proof by example 25. Prove or disprove that there are three consecutive odd positive

Proof by example 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. 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) ) Constructive existence proof: 3, 5, 7

Proof by example 47. Prove that if you have an eight gallon jug of

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. 48. 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) 8, 5, 3 ® (6, 0, 2) ® (1, 5, 2) ® (1, 4, 3)

Open problems Fermat’s last theorem n n xn+yn=zn has no solutions in integers when

Open problems Fermat’s last theorem n n xn+yn=zn has no solutions in integers when xyz≠ 0 and n>2 Finally proven! Goldbach’s Conjecture n n n Every integer n (for n>2) is the sum of 2 primes Shown for all n up to 4*1014 Thought to be true Twin prime conjecture n n There an infinitely many number of primes that differ by 2 Biggest twin prime: 318, 032, 361*2107, 001± 1 That number has 32, 220 digits! n Thought to be true 22

Open problems 3 x+1 conjecture n n Let f(x) return x/2 if x is

Open problems 3 x+1 conjecture n n Let f(x) return x/2 if x is even, and 3 x+1 if x is odd Shown for all numbers up to 5. 6*1013 23

The Halting problem Is it possible to write a function that will tell if

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) n 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 else loop forever We then call K(K) 24

The Halting problem Function K: function K (s) if H (s, s) = “loops

The Halting problem Function K: function K (s) if H (s, s) = “loops forever” then halt else loop forever We call K(K) n n Note that this calls H(K, K), which in turn calls K(K) If H(K, K) returns “halt”, then K loops forever But H(K, K) stated that K halts! n If H(K, K) returns “loops forever”, then K halts But H(K, K) stated that K loops forever! Both cases reached contradictions 25

Adapting existing proofs Look at existing proofs n n To use as a “template”

Adapting existing proofs Look at existing proofs n n To use as a “template” for your proofs To build upon for your proofs 26

Reuse 49. Show that the problem of determining whether a program with a given

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). • 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. 27

Quick survey n a) b) c) d) I felt I understood the material in

Quick survey n a) b) c) d) I felt I understood the material in this slide set… Very well With some review, I’ll be good Not really Not at all 28

Quick survey n a) b) c) d) The pace of the lecture for this

Quick survey n a) b) c) d) The pace of the lecture for this slide set was… Fast About right A little slow Too slow 29

Quick survey n a) b) c) d) How interesting was the material in this

Quick survey n a) b) c) d) How interesting was the material in this slide set? Be honest! Wow! That was SOOOOOO cool! Somewhat interesting Rather borting Zzzzzz 30