theory of computation
play

Theory of Computation Course note based on Computability, Complexity, - PowerPoint PPT Presentation

Preliminaries (1) Primitive Recursion Functions (3) Theory of Computation Course note based on Computability, Complexity, and Languages: Fundamentals of Theoretical Computer Science , 2nd edition, authored by Martin Davis, Ron Sigal, and Elaine


  1. Preliminaries (1) Primitive Recursion Functions (3) Theory of Computation Course note based on Computability, Complexity, and Languages: Fundamentals of Theoretical Computer Science , 2nd edition, authored by Martin Davis, Ron Sigal, and Elaine J. Weyuker. course note prepared by Tyng–Ruey Chuang Institute of Information Science, Academia Sinica Department of Information Management, National Taiwan University Week 3, Spring 2008 1 / 46

  2. Preliminaries (1) Primitive Recursion Functions (3) About This Course Note ◮ It is prepared for the course Theory of Computation taught at the National Taiwan University in Spring 2008. ◮ It follows very closely the book Computability, Complexity, and Languages: Fundamentals of Theoretical Computer Science , 2nd edition, by Martin Davis, Ron Sigal, and Elaine J. Weyuker. Morgan Kaufmann Publishers. ISBN: 0-12-206382-1. ◮ It is available from Tyng-Ruey Chuang’s web site: http://www.iis.sinica.edu.tw/~trc/ and released under a Creative Commons “Attribution-ShareAlike 2.5 Taiwan” license: http://creativecommons.org/licenses/by-sa/2.5/tw/ 2 / 46

  3. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Predicate A predicate , or a Boolean-valued function , on a set S is a total function P on S such that for each a ∈ S , either P ( a ) = TRUE or P ( a ) = FALSE We also identify the truth value TRUE with number 1 and the truth value FALSE with number 0. 3 / 46

  4. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Logic Connectives The three logic connectives , or propositional connectives , ∼ , ∨ , & are defined by the two tables below. p ∼ p p q p & q p ∨ q 0 1 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 0 0 0 4 / 46

  5. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Characteristic Function Given a predicate P on a set S , there is a corresponding subset R of S consisting of all elements a ∈ S for which P ( a ) = 1. We write R = { a ∈ S | P ( a ) } . 5 / 46

  6. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Characteristic Function Given a predicate P on a set S , there is a corresponding subset R of S consisting of all elements a ∈ S for which P ( a ) = 1. We write R = { a ∈ S | P ( a ) } . Conversely, given a subset R of a given set S , the expression x ∈ R defines a predicate P on S: � 1 if x ∈ R P ( x ) = 0 if x �∈ R . The predicate P is called the characteristic function of the set R . 5 / 46

  7. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Characteristic Function Given a predicate P on a set S , there is a corresponding subset R of S consisting of all elements a ∈ S for which P ( a ) = 1. We write R = { a ∈ S | P ( a ) } . Conversely, given a subset R of a given set S , the expression x ∈ R defines a predicate P on S: � 1 if x ∈ R P ( x ) = 0 if x �∈ R . The predicate P is called the characteristic function of the set R . Note the easy translations between the two notations: { x ∈ S | P ( x ) & Q ( x ) } = { x ∈ S | P ( x ) } ∩ { x ∈ S | Q ( x ) } , { x ∈ S | P ( x ) ∨ Q ( x ) } = { x ∈ S | P ( x ) } ∪ { x ∈ S | Q ( x ) } , { x ∈ S | ∼ P ( x ) } = S − { x ∈ S | P ( x ) } . 5 / 46

  8. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Bounded Existential Quantifier Let P ( t , x 1 , . . . , x n ) be a ( n + 1)-ary predicate. Let predicate Q ( y , x 1 , . . . , x n ) be defined by Q ( y , x 1 , . . . , x n ) = P (0 , x 1 , . . . , x n ) ∨ P (1 , x 1 , . . . , x n ) ∨ . . . ∨ P ( y , x 1 , . . . , x n ) 6 / 46

  9. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Bounded Existential Quantifier Let P ( t , x 1 , . . . , x n ) be a ( n + 1)-ary predicate. Let predicate Q ( y , x 1 , . . . , x n ) be defined by Q ( y , x 1 , . . . , x n ) = P (0 , x 1 , . . . , x n ) ∨ P (1 , x 1 , . . . , x n ) ∨ . . . ∨ P ( y , x 1 , . . . , x n ) That is, Q ( y , x 1 , . . . , x n ) is true if there is a value t ≤ y such that P ( t , x 1 , . . . , x n ) is true. We write this predicate Q as ( ∃ t ) ≤ y P ( t , x 1 , . . . , x n ) “( ∃ t ) ≤ y ” is called a bounded existential quantifier . 6 / 46

  10. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Bounded Universal Quantifier Let P ( t , x 1 , . . . , x n ) be a ( n + 1)-ary predicate. Let predicate Q ( y , x 1 , . . . , x n ) be defined by Q ( y , x 1 , . . . , x n ) = P (0 , x 1 , . . . , x n ) & P (1 , x 1 , . . . , x n ) & . . . & P ( y , x 1 , . . . , x n ) 7 / 46

  11. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Bounded Universal Quantifier Let P ( t , x 1 , . . . , x n ) be a ( n + 1)-ary predicate. Let predicate Q ( y , x 1 , . . . , x n ) be defined by Q ( y , x 1 , . . . , x n ) = P (0 , x 1 , . . . , x n ) & P (1 , x 1 , . . . , x n ) & . . . & P ( y , x 1 , . . . , x n ) That is, Q ( y , x 1 , . . . , x n ) is true if for all value t ≤ y such that P ( t , x 1 , . . . , x n ) is true. We write this predicate Q as ( ∀ t ) ≤ y P ( t , x 1 , . . . , x n ) “( ∀ t ) ≤ y ” is called a bounded universal quantifier . 7 / 46

  12. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Proof by Contradiction In a proof by contradiction , we begin by assuming the assertion we wish to prove is false . We then derive a contradiction based on this (faulty) assumption along with (faultless) logical reasoning. We then conclude that the original assertion must be true. 8 / 46

  13. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Proof by Contradiction: Example Prove that the equation 2 = ( m / n ) 2 has no solution m , n ∈ N . 9 / 46

  14. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Proof by Contradiction: Example Prove that the equation 2 = ( m / n ) 2 has no solution m , n ∈ N . Proof . Assume 2 = ( m / n ) 2 has a solution m , n ∈ N . Then it must also have a solution where not both m and n are even. This is so because we can repeatedly “cancel” 2 from m and n until at least one of them becomes odd , and still have the two “reduced” numbers as a solution. 9 / 46

  15. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Proof by Contradiction: Example Prove that the equation 2 = ( m / n ) 2 has no solution m , n ∈ N . Proof . Assume 2 = ( m / n ) 2 has a solution m , n ∈ N . Then it must also have a solution where not both m and n are even. This is so because we can repeatedly “cancel” 2 from m and n until at least one of them becomes odd , and still have the two “reduced” numbers as a solution. However, the equation 2 = ( m / n ) 2 can be rewritten as m 2 = 2 n 2 which shows that m must be even. Let m = 2 k , then m 2 = (2 k ) 2 = 4 k 2 . But this implies n 2 = 2 k 2 . Thus n is even. Now both m and n are even, which is a contradiction. 9 / 46

  16. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Proof by Contradiction: Example Prove that the equation 2 = ( m / n ) 2 has no solution m , n ∈ N . Proof . Assume 2 = ( m / n ) 2 has a solution m , n ∈ N . Then it must also have a solution where not both m and n are even. This is so because we can repeatedly “cancel” 2 from m and n until at least one of them becomes odd , and still have the two “reduced” numbers as a solution. However, the equation 2 = ( m / n ) 2 can be rewritten as m 2 = 2 n 2 which shows that m must be even. Let m = 2 k , then m 2 = (2 k ) 2 = 4 k 2 . But this implies n 2 = 2 k 2 . Thus n is even. Now both m and n are even, which is a contradiction. We conclude that 2 = ( m / n ) 2 has no solution m , n ∈ N . � 9 / 46

  17. Predicates (1.4) Preliminaries (1) Quantifiers (1.5) Primitive Recursion Functions (3) Proof by Contradiction (1.6) Mathematical Induction (1.7) Mathematical Induction Given a predicate P ( x ), and the assertion “ P ( n ) is true for all n ∈ N ”, we can use mathematical induction to try to establish this assertion. One proceeds by proving a pair of auxiliary statements about P ( x ), namely, P (0) and For all n ∈ N, P ( n ) implies P ( n + 1) 10 / 46

Recommend


More recommend