cpsc 121 models of computation
play

CPSC 121: Models of Computation should be able to: Identify the - PowerPoint PPT Presentation

Pre-Class Learning Goals By the start of class, for each proof strategy below, you CPSC 121: Models of Computation should be able to: Identify the form of statement the strategy can prove. Sketch the structure of a proof that uses the


  1. Pre-Class Learning Goals  By the start of class, for each proof strategy below, you CPSC 121: Models of Computation should be able to:  Identify the form of statement the strategy can prove.  Sketch the structure of a proof that uses the strategy.  Strategies for quantifiers: Unit 7: Proof Techniques (for ∀ x ∈ Z . . .)  generalizing from the generic particular (WLOG)  constructive/non-constructive proofs of existence (for ∃ x ∈ Z . . .)  proof by exhaustion (for ∀ x ∈ Z . . .)  General strategies (for p → q.)  antecedent assumption proof (for p → q.)  proof by contrapositive  proof by contradiction (for any statement.)  proof by cases. (for any statement.) Based on slides by Patrice Belleville and Steve Wolfman Unit 7- Proof Techniques 2 Quiz 7 Feedback: In-Class Learning Goals  In general :  By the end of this unit, you should be able to:  Devise and attempt multiple different, appropriate proof  Issues: strategies for a given theorem, including o all those listed in the "pre-class" learning goals o logical equivalences, o propositional rules of inference o rules of inference on quantifiers i.e. be able to apply the strategies listed in the Guide to Proof Strategies reference sheet on the course web site (in Other Handouts)  We will do more proof examples in class.  For theorems requiring only simple insights beyond strategic choices or for which the insight is given/hinted, additionally prove the theorem. Unit 7- Proof Techniques Unit 7- Proof Techniques 3 4 1

  2. ? ? Where We Are in The BIG Questions Unit Outline  How can we convince ourselves that an algorithm  Techniques for quantifiers . does what it's supposed to do? NOTE:  Existential quantifiers.  We need to prove its correctness. Epp calls some of these direct proofs  How do we determine whether or not one algorithm is  Universal quantifiers. and others indirect. better than another one? We’ll avoid using  Dealing with multiple quantifiers. these terms  Sometimes, we need a proof to convince someone that the number of steps of our algorithm is what we claim it is.  Using logical equivalencies : Proof by contrapositive  Using Premises  Proof by contradiction  Additional Examples Unit 7- Proof Techniques 5 Unit 7- Proof Techniques 6 Techniques for quantifiers Existential Statements Suppose the statement has the form :  There are two general forms of statements: ∃ x ∈ D, P(x) o Those that start with an existential quantifier.  To prove this statement is true, we must o Those that start with a universal quantifier.  Find a value of x (a “witness”) for which P(x) holds.  We call it a witness proof  We use different techniques for them. We’ll study each case in turns.  So the proof will look like this:  Let x = <some value in D>  Verify that the x we chose satisfies the predicate.  Example: There is a prime number x such that 3x+2 is not prime. Unit 7- Proof Techniques Unit 7- Proof Techniques 7 8 2

  3. Existential Statements (cont’) Existential Statements (cont’)  How do we translate  What is the right start of the proof for the statement There is a prime number x such that 3x+2 is not prime There is a prime number x such that 3x+2 is not into predicate logic ? prime ? A. ∀ x ∈ Z + , Prime(x) ∧ ~Prime(3x+2) A. Without loss of generality let x be a positive integer …. B. ∃ x ∈ Z + , Prime(x) ∧ ~Prime(3x+2) B. Without loss of generality let x be a prime …. C. ∀ x ∈ Z + , Prime(x) → ~Prime(3x+2) C. Let x be any non specific prime …… D. ∃ x ∈ Z + , Prime(x) → ~Prime(3x+2) D. Let x be 2 …… E. None of the above. E. None of the above. Unit 7- Proof Techniques 9 Unit 7- Proof Techniques 10 Existential Statements (cont’) Unit Outline  So the proof goes as follows:  Techniques for direct proofs.  Proof:  Existential quantifiers. o Let x =  Universal quantifiers. o It is prime because its only factors are 1 and o Now 3x+2 =  Dealing with multiple quantifiers. and  Using logical equivalencies : Proof by contrapositive o Hence 3x+2 is not prime. o QED.  Using Premises  Proof by contradiction  Additional Examples Unit 7- Proof Techniques Unit 7- Proof Techniques 11 12 3

  4. Universal Statements (cont’) Universal Statements Suppose our statement has the form :  Terminology: the following statements all mean the ∀ x ∈ D, P(x) same thing:  To prove this statement is true, we must  Let x be a nonspecific element of D  Show that P(x) holds no matter how we choose x.  Let x be an unspecified element of D  So the proof will look like this:  Let x be an arbitrary element of D  Let x be a generic element of D  Without loss of generality, let x be any element of D  Let x be any element of D (or an equivalent expression like those shown on next page)  Suppose x is a particular but arbitrarily chosen element of D.  Verify that the predicate P holds for this x. o Note: the only assumption we can make about x is the fact that it belongs to D. So we can only use properties common to all elements of D. Unit 7- Proof Techniques 13 Unit 7- Proof Techniques 14 Universal Statements (cont’) Universal Statements (cont’)  Example: Every Racket function definition is at least 12  Example 1: Every Racket function definition is at least characters long. 12 characters long.  What is the starting phrase of a proof for this statement?  The proof goes as follows:  Proof: A. Without loss of generality let f be a string of 12 characters …. o Let f be B. Let f be a nonspecific Racket function definition…. o Then f should look like: C. Let f be the following Racket function definition …… D. Let f be a nonspecific Racket function with 12 or more characters …. o Therefore f is at least 12 characters long. E. None of the above. Unit 7- Proof Techniques Unit 7- Proof Techniques 15 16 4

  5. Antecedent Assumption (cont’) Special Case : Antecedent Assumption  Why is the line Assume that P(k) is true valid? Suppose the statement has the form: ∀ x ∈ D, P(x) → Q(x) A. Because these are the only cases where Q(k)  This is a special case of the previous formula matters.  The textbook calls this (and only this) a direct proof. B. Because P(k) is preceded by a universal quantifier.  The proof looks like this: C. Because we know that P(k) is true.  Proof: o Consider an unspecified element k of D. D. Both (a) and (c) o Assume that P(k) is true. E. Both (b) and (c) o Use this and properties of the element of D to verify that the predicate Q holds for this k. Unit 7- Proof Techniques 17 Unit 7- Proof Techniques 18 Antecedent Assumption (cont’) Antecedent Assumption (cont’) Example 2: The sum of two odd numbers is even.  Example: prove that Odd(x)  ∃ k ∈ N, x = 2k+1  If  ∀ n ∈ N, n ≥ 1024 → 10n ≤ nlog 2 n Even(x)  ∃ k ∈ N, x = 2k  Proof: the above statement is:  WLOG let n be an unspecified natural number. ∀ n ∈ N, ∀ m ∈ N, Odd(n) ᴧ Odd(m) → Even( n+m)  Assume that Proof:  Then  Let n be an arbitrary natural number.  Let m be an arbitrary natural number.  Assume that n and m are both odd.  Then n = 2i+1 for some natural number i, and m = 2j+1 for some natural number j  Then m+n = 2i+1 + 2j+1 = 2i + 2j + 2 = 2(i+j+1)  Since i+j+1 is a natural number, 2(i+j+1) is even and so is n+m.  QED  Unit 7- Proof Techniques Unit 7- Proof Techniques 19 20 5

  6. … and for fun … Unit Outline  Other interesting proof techniques ☺  Techniques for direct proofs.  Proof by intimidation  Existential quantifiers.  Proof by lack of space (Fermat's favorite!)  Universal quantifiers.  Proof by authority  Proof by never-ending revision  Dealing with multiple quantifiers .  Using logical equivalencies : Proof by contrapositive  For the full list, see:  http://school.maths.uwa.edu.au/~berwin/humour/invalid.proo  Using Premises fs.html  Proof by contradiction  Additional Examples Unit 7- Proof Techniques 21 Unit 7- Proof Techniques 22 Multiple Quantifiers Multiple Quantifiers: Example  Theorem:  i  Z + ,  n  Z + , n  i  60n < n 2  How do we deal with theorems that involve multiple quantifiers?  We can think of it as a statement of the form  Start the proof from the outermost quantifier.  i  Z + , P(i) ,  Work our way inwards. where P(i)   n  Z + , n  i  60n < n  Example: Suppose we wan to prove:  So, how do we pick i An algorithm whose run time is t(n) = 60n is generally faster than an algorithm whose time is n 2 , i.e. we want to show that A. Let i be any specific integer. as n increases, 60n < n 2 B. Without loss of generality, let i be any arbitrary positive integer  The statement in predicate logic is:  i  Z + ,  n  Z + , n  i  60n < n 2 C. Let i = (a specific value) D. None of the above Unit 7- Proof Techniques Unit 7- Proof Techniques 23 24 6

Recommend


More recommend