September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 1 Some Primitive Recursive Functions Example 3: h(x) = x! Here are.

Slides:



Advertisements
Similar presentations
Primitive Recursive Functions (Chapter 3)
Advertisements

Joint and marginal distribution functions For any two random variables X and Y defined on the same sample space, the joint c.d.f. is For an example, see.
October 13, 2009Theory of Computation Lecture 11: A Universal Program III 1 Coding Programs by Numbers Gödel numbers are usually very large, even for small.
3.3 Differentiation Formulas
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Mu-Recursive Functions
INTEGRALS The Fundamental Theorem of Calculus INTEGRALS In this section, we will learn about: The Fundamental Theorem of Calculus and its significance.
November 17, 2009Theory of Computation Lecture 18: Calculations on Strings III 1 Numerical Representation of Strings We will now look at several primitive.
October 27, 2009Theory of Computation Lecture 12: A Universal Program IV 1Universality Then we append the following instruction: [C]IF K = Lt(Z) + 1 
Complexity1 Pratt’s Theorem Proved. Complexity2 Introduction So far, we’ve reduced proving PRIMES  NP to proving a number theory claim. This is our next.
November 10, 2009Theory of Computation Lecture 16: Computation on Strings I 1Diagonalization Another example: Let TOT be the set of all numbers p such.
September 24, 2009Theory of Computation Lecture 6: Primitive Recursive Functions II 1 Homework Questions Question 1: Write a program P that computes 
September 17, 2009Theory of Computation Lecture 4: Programs and Computable Functions III 1 Macros Now we want to use macros of the form: W  f(V 1, …,
October 1, 2009Theory of Computation Lecture 8: Primitive Recursive Functions IV 1 Primitive Recursive Predicates Theorem 6.1: Let C be a PRC class. If.
November 3, 2009Theory of Computation Lecture 14: A Universal Program VI 1 Recursively Enumerable Sets Definition: We write: W n = {x  N |  (x, n) 
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
2.2 Remainder and Factor Theorems 1 Remainder Theorem If the polynomial f(x) is divided by x  c, then the remainder is equal to f(c). In other words,
Applied Discrete Mathematics Week 9: Relations
4.2 - The Mean Value Theorem
Continuity ( Section 1.8) Alex Karassev. Definition A function f is continuous at a number a if Thus, we can use direct substitution to compute the limit.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
Integrals 5. The Fundamental Theorem of Calculus 5.4.
DERIVATIVES 3. If it were always necessary to compute derivatives directly from the definition, as we did in the Section 3.2, then  Such computations.
DERIVATIVES 3. If it were always necessary to compute derivatives directly from the definition, as we did in the Section 3.2, then  Such computations.
3.2 The Product and Quotient Rules DIFFERENTIATION RULES In this section, we will learn about:  Formulas that enable us to differentiate new functions.
First-Order Differential Equations Part 1
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Universidad Nacional de ColombiaUniversidad Nacional de Colombia Facultad de IngenieríaFacultad de Ingeniería Departamento de Sistemas- 2002Departamento.
TECHNIQUES OF INTEGRATION Due to the Fundamental Theorem of Calculus (FTC), we can integrate a function if we know an antiderivative, that is, an indefinite.
3 DERIVATIVES.  Remember, they are valid only when x is measured in radians.  For more details see Chapter 3, Section 4 or the PowerPoint file Chapter3_Sec4.ppt.
1. 3x + 2 = ½ x – 5 2. |3x + 2| > x – 5 < -3x |x + 2| < 15 Algebra II 1.
Theory of Computation Lecture 5: Primitive Recursive Functions I
November 12, 2009Theory of Computation Lecture 17: Calculations on Strings II 1 Numerical Representation of Strings First, we define two primitive recursive.
Equivalence Relations Lecture 45 Section 10.3 Fri, Apr 8, 2005.
Direct Proof and Counterexample I Lecture 11 Section 3.1 Fri, Jan 28, 2005.
Real Zeros of Polynomial Functions
Last Answer LETTER I h(x) = 3x 4 – 8x Last Answer LETTER R Without graphing, solve this polynomial: y = x 3 – 12x x.
October 4, 2016Theory of Computation Lecture 9: A Universal Program I 1Minimalization Example 15: R(x, y) R(x, y) is the remainder when x is divided by.
Another Word on PRC Classes
Theory of Computation Lecture 10: A Universal Program I
Polynomials.
Chapter 2: Equations of Order One
Theory of Computation Lecture 12: A Universal Program III
2.7 Combining Functions.
Theory Of Computer Science
Diagonalization and Reducibility
Theory of Computation Lecture 14: A Universal Program V
Recursively Enumerable Sets
Theory of Computation Lecture 16: A Universal Program VII
Theory of Computation Lecture 5: Programs and Computable Functions III
Theory of Computation Lecture 6: Primitive Recursive Functions I
Theory Of Computer Science
Applied Discrete Mathematics Week 2: Proofs
5.1 Power Series Method Section 5.1 p1.
Mathematical Induction I
Function Notation and Evaluating Functions
Applied Discrete Mathematics Week 9: Integer Properties
Direct Proof and Counterexample I
One-to-One and Onto, Inverse Functions
One-to-One and Onto, Inverse Functions
Diagonalization and Reducibility
Recursively Enumerable Sets
Primitive Recursive Predicates
Theory of Computation Lecture 9: A Universal Program I
Theory of Computation Lecture 6: Primitive Recursive Functions I
Some Primitive Recursive Functions
Theory of Computation Lecture 13: A Universal Program V
Recursively Enumerable Sets
Theory of Computation Lecture 17: Calculations on Strings II
Theory of Computation Lecture 11: A Universal Program III
Presentation transcript:

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 1 Some Primitive Recursive Functions Example 3: h(x) = x! Here are the recursion equations: h(0) = 1 h(t + 1) = h(t)  s(t) This can be rewritten as: h(0) = s(n(t)) h(t + 1) = g(t, h(t)) where g(x 1, x 2 ) = s(x 1 )  x 2, which can be written as: g(x 1, x 2 ) = s(u 1 2 (x 1, x 2 ))  u 2 2 (x 1, x 2 ). Multiplication is already known to be primitive recursive. Therefore, h(x) = x! is primitive recursive.

September 21, 2006Theory of Computation Lecture 6: Primitive Recursive Functions II 2 Some Primitive Recursive Functions In the following examples, we just show the recursive mechanism without developing the precise form of the recursion equations. Example 4: x y The recursion equations are: x 0 = 1 x y+1 = x y  x

September 21, 2006Theory of Computation Lecture 6: Primitive Recursive Functions II 3 Some Primitive Recursive Functions Example 5: The predecessor function p(x) It is defined as follows: p(x) = x – 1 if x  0 = 0 if x = 0 = 0 if x = 0 The recursion equations are: p(0) = 0 p(t + 1) = t

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 4 Some Primitive Recursive Functions Example 6: x -  y (monus) It is defined as follows: x -  y = x – y if x  y = 0 if x < y = 0 if x < y The recursion equations are: x -  0 = x x -  (t + 1) = p(x -  t)

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 5 Some Primitive Recursive Functions Example 7: | x – y | The function | x – y | is defined as the absolute value of the difference between x and y. It can be written as follows: | x – y | = (x -  y) + (y -  x) Therefore, | x – y | is primitive recursive.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 6 Some Primitive Recursive Functions Example 8:  (x) (“negation”) The function  (x) is defined as follows:  (x) = 1 if x = 0 = 0 if x  0 = 0 if x  0  (x) is primitive recursive, because:  (x) = 1 -  x If we prefer, we can just write down the recursion equations:  (0) = 1  (t + 1) = 0

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 7 Primitive Recursive Predicates Example 9: x = y We can describe this predicate by the function d(x, y): d(x, y) = 1 if x = y = 0 if x  y = 0 if x  y d(x, y) is primitive recursive because of the following equation: d(x, y) =  (|x – y|)

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 8 Primitive Recursive Predicates Example 10: x  y Again, we can describe this predicate by the function d(x, y): d(x, y) = 1 if x  y = 0 if x > y = 0 if x > y d(x, y) is primitive recursive because of the following equation: d(x, y) =  (x –  y)

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 9 Primitive Recursive Predicates Theorem 5.1: Let C be a PRC class. If P, Q are predicates that belong to C, then so are  P, P  Q, and P&Q. Proof: Since  P =  (P), it follows that  P belongs to C. Since P&Q = P  Q, it follows that P&Q belongs to C. Since P  Q =  (  P &  Q), it follows that P  Q belongs to C.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 10 Primitive Recursive Predicates We already know two different PRC classes, namely the class of all primitive recursive functions, and the class of all computable functions. Correspondingly, we have the following corollaries: Corollary 5.2: If P, Q are primitive recursive predicates, then so are  P, P  Q, and P&Q. Corollary 5.3: If P, Q are computable predicates, then so are  P, P  Q, and P&Q.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 11 Primitive Recursive Predicates Example 11: x < y So far, we only know that x  y and x = y are primitive recursive predicates (Examples 9 and 10). Since we have the tautology x < y  x  y &  (x = y) or even simpler: x < y   (y  x), according to Corollary 5.2, x < y is also a primitive recursive predicate.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 12 Primitive Recursive Predicates Theorem 5.4: Let C be a PRC class. Let the functions g, h and the predicate P belong to C. Let f(x 1, …, x n ) = g(x 1, …, x n ) if P(x 1, …, x n ) = h(x 1, …, x n ) otherwise. = h(x 1, …, x n ) otherwise. Then f belongs to C. Proof: f obviously belongs to C, because it can be written as: f(x 1, …, x n ) = g(x 1, …, x n )  P(x 1, …, x n ) + h(x 1, …, x n )  (P(x 1, …, x n ))

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 13 Primitive Recursive Predicates Corollary 5.5: Let C be a PRC class. Let n-ary functions g 1, …, g m, h and predicates P 1, …, P m belong to C, and let P i (x 1, …, x n ) & P j (x 1, …, x n ) = 0 for all 1  i < j  m and all x 1, …, x n. If f(x 1, …, x n ) = g 1 (x 1, …, x n ) if P 1 (x 1, …, x n ) = g 2 (x 1, …, x n ) if P 2 (x 1, …, x n ) = g 2 (x 1, …, x n ) if P 2 (x 1, …, x n ) : : = g m (x 1, …, x n ) if P m (x 1, …, x n ) = g m (x 1, …, x n ) if P m (x 1, …, x n ) = h(x 1, …, x n ) otherwise. = h(x 1, …, x n ) otherwise. Then f belongs to C.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 14 Primitive Recursive Predicates Proof: The idea is to use induction on the variable m. Theorem 5.4 provides the case for m = 1, so we just have to do the inductive step. Let f(x 1, …, x n ) = g 1 (x 1, …, x n ) if P 1 (x 1, …, x n ) : : = g m+1 (x 1, …, x n ) if P m+1 (x 1, …, x n ) = g m+1 (x 1, …, x n ) if P m+1 (x 1, …, x n ) = h(x 1, …, x n ) otherwise, and let = h(x 1, …, x n ) otherwise, and let h’(x 1, …, x n ) = g m+1 (x 1, …, x n ) if P m+1 (x 1, …, x n ) = h(x 1, …, x n ) otherwise. Then = h(x 1, …, x n ) otherwise. Then f(x 1, …, x n ) = g 1 (x 1, …, x n ) if P 1 (x 1, …, x n ) : : = g m (x 1, …, x n ) if P m (x 1, …, x n ) = g m (x 1, …, x n ) if P m (x 1, …, x n ) = h’(x 1, …, x n ) otherwise. = h’(x 1, …, x n ) otherwise.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 15 Primitive Recursive Predicates The previous steps showed that f belongs to C for m = 1 f belongs to C for m = 1 whenever f belongs to C for a particular m, then f also belongs to C for m + 1. whenever f belongs to C for a particular m, then f also belongs to C for m + 1. Conclusion: f belongs to C for any natural number m.

September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 16 Primitive Recursive Predicates Theorem 6.1: Let C be a PRC class. If f(t, x 1, …, x n ) belongs to C, then so do the functions To prove this theorem, we will show that g and h can be obtained from f by primitive recursion.