Upcoming SlideShare
×

# Theory of Computation: Primitive Recursively Closed Classes & Definition by Cases, Summations & Products, Bounded Quantification, Bounded Quantification & Primitive Recursive Predicates

430
-1

Published on

Primitive Recursively Closed Classes & Definition by Cases, Summations & Products, Bounded Quantification, Bounded Quantification & Primitive Recursive Predicates

Published in: Science, Spiritual
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
430
On Slideshare
0
From Embeds
0
Number of Embeds
38
Actions
Shares
0
0
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Theory of Computation: Primitive Recursively Closed Classes & Definition by Cases, Summations & Products, Bounded Quantification, Bounded Quantification & Primitive Recursive Predicates

1. 1. Theory of Computation Primitive Recursively Closed Classes & Definition by Cases, Summations & Products, Bounded Quantification, Bounded Quantification & Primitive Recursive Predicates Vladimir Kulyukin www.vkedco.blogspot.com
2. 2. Outline ● ● ● ● Primitive Recursively Closed Classes & Definition by Cases Summations & Products Bounded Quantification Bounded Quantification & Primitive Recursive Predicates
3. 3. Primitive Recursively Closed Classes & Definition by Cases
4. 4. Theorem 5.4 (Ch. 3): Definition by Cases Let C be a PRC class. Let the functions g , h, and the predicate P belong to C. Let g ( x1 ,..., xn ) if P ( x1 ,..., xn ) f ( x1 ,..., xn ) =  h( x1 ,..., xn ) otherwise. Then f ( x1 ,..., xn ) ∈ C.
5. 5. Proof 5.4 (Ch. 3) f ( x1 ,..., x n ) = g ( x1 ,..., x n ) ⋅ P( x1 ,..., x n ) + h( x1 ,..., x n ) ⋅ α ( P( x1 ,..., x n ) )
6. 6. Interpretation of Theorem 5.4 (Ch. 3) Theorem 5.4 (Ch. 3) shows that it is possible to write if-thenelse statements from the functions that we have defined previously and we know to be in the same PRC class. if ( P(x1, …, xn) ) { return g(x1, …, xn); } else { return h(x1, …, xn); }
7. 7. Corollary 5.5 (Ch. 3) Let C be a PRC class, let n - ary functions g1 ,..., g m , h and predicates P ,..., Pm belong 1 to C , and let Pi ( x1 ,..., xn ) ⋅ Pj ( x1 ,..., xn ) = 0, for all 1 ≤ i < j ≤ m and all x1 ,..., xn . Let g1 ( x1 ,..., xn ) if P ( x1 ,..., xn ) 1 ...  f ( x1 ,..., xn ) =  g m ( x1 ,..., xn ) if Pm ( x1 ,..., xn ) h( x1 ,..., xn ) otherwise.  Then f ∈ C.
8. 8. Proof 5.5 (Ch. 3) We prove this statement by induction on m. If m = 1, the statement is true by Theorem 5.4 (Ch. 3). Consider m + 1.  g1 ( x1 ,..., xn ) if P1 ( x1 ,..., xn ) ...  f ( x1 ,..., xn ) =   g m +1 ( x1 ,..., xn ) if Pm +1 ( x1 ,..., xn ) h( x1 ,..., xn ) otherwise 
9. 9. Proof 5.5 (Ch. 3) We rewrite the last two functions as one : Let h ( x1 ,..., x n ) '' g m +1 ( x1 ,..., x n ) if Pm +1 ( x1 ,..., x n ) = h( x1 ,..., x n ) otherwise. Then h '' ( x1 ,..., x n ) ∈ C , by Theorem 5.4 (Ch. 3). And f ( x1 ,..., x n ) g1 ( x1 ,..., x n ) if P1 ( x1 ,..., x n ) ...  = g m ( x1 ,..., x n ) if Pm ( x1 ,..., x n ) h '' ( x ,..., x ) otherwise. 1 n  Then f ( x1 ,..., x n ) ∈ C , by induction.
10. 10. Corollary 5.5 (Ch. 3): Interpretation We can write if-then-else-if statements from previously defined functions in the same PRC class: if ( P1(x1, …, xn) ) { return g1(x1, …, xn); } else if ( P2(x1, …, xn) ) { return g2(x1, …, xn); } … else { return h(x1, …, xn); }
11. 11. Summations & Products
12. 12. Theorem 6.1 (Ch. 3) Let C be a PRC class. If f (t , x1 ,..., xn ) ∈ C , then so do the functions y g ( y, x1 ,..., xn ) = ∑ f (t ,x1 ,..., xn ) t =0 and y h( y, x1 ,..., xn ) = ∏ f (t , x1 ,..., xn ). t =0
13. 13. Proof 6.1 We can use the definition of the PRC class. We know that C is a PRC class. We know that f is in C. If we can derive g from f using composition and recursion, g will, by definition, be in C.
14. 14. Proof 6.1 (Ch. 3) y Let us write the recurrences for g ( y, x1 ,..., xn ) = ∑ f ( t , x1 ,..., xn ) : t =0 g (0, x1 ,..., xn ) = f (0, x1 ,..., xn ); g (t + 1, x1 ,..., xn ) = g (t , x1 ,..., xn ) + f (t + 1, x1 ,..., xn ).
15. 15. Proof 6.1 (Ch. 3) y Let us write the recurrences for h( y, x1 ,..., x n ) = ∏ f (t , x1 ,..., x n ) : t =0 h(0, x1 ,..., x n ) = f (0, x1 ,..., x n ) h(t + 1, x1 ,..., x n ) = h(t , x1 ,..., x n ) ⋅ f (t + 1, x1 ,..., x n )
16. 16. Starting Summation at 1 Suppose we want to start summing at 1 : y g ( y, x1 ,..., x n ) = ∑ f (t , x1 ,..., x n ). t =1 We can adjust the recurrences : g (0, x1 ,..., x n ) = 0 g (t + 1, x1 ,..., x n ) = g (t , x1 ,..., x n ) + f (t + 1, x1 ,..., x n )
17. 17. Starting Product at 1 Suppose that we want to start products at 1 : y h( y, x1 ,..., x n ) = ∏ f (t , x1 ,..., x n ). t =1 We can adjust the recurrences as follows : h(0, x1 ,..., x n ) = 1 h(t + 1, x1 ,..., x n ) = h(t , x1 ,..., x n ) ⋅ f (t + 1, x1 ,..., x n )
18. 18. Corollary 6.2 (Ch. 3) If f (t , x1 ,..., xn ) ∈ C and C is PRC, then so do these functions : y g ( y, x1 ,..., xn ) = ∑ f (t ,x1 ,..., xn ); t =1 y h( y, x1 ,..., xn ) = ∏ f (t , x1 ,..., xn ). t =1
19. 19. Bounded Quantification
20. 20. Bounded Universal Quantifier: Definition ( ∀t ) ≤ y P( t , x1 ,..., x n ) is 1 ( TRUE ) P ( i, x1 ,..., x n ) = 1, for 0 ≤ i ≤ y if and only if
21. 21. Bounded Existential Quantifier: Definition ( ∃t ) ≤ y P( t , x1 ,..., x n ) is 1 (TRUE) if and only if P ( i, x1 ,..., x n ) = 1, for at least one i ∈ [ 0, y ]
22. 22. Theorem 6.3 (Ch. 3) If the predicate P (t , x1 ,..., x n ) belongs to some PRC class C , then so do the predicates (∀t ) ≤ y P (t , x1 ,..., x n ) and (∃t ) t ≤ y P (t , x1 ,..., x n ).
23. 23. Proof 6.3 (Ch. 3) We can define the bounded universal quantification in terms of the product as follows :   (∀t ) ≤ y P (t , x1 ,..., x n ) ⇔ ∏ P ( t , x1 ,..., x n )  = 1  t =0  y
24. 24. Proof 6.3 (Ch. 3) We can define the bounded existential quantification in terms of the summation as follows :  y   (∃t ) ≤ y P (t , x1 ,..., x n ) ⇔ ¬ ∑ P ( t , x1 ,..., x n )  = 0    t =0 
25. 25. Corollary of Theorem 6.3 (Ch. 3) Theorem 6.3 is valid for strict bounded quantification : (∀t ) < y P (t , x1 ,..., x n ) ⇔ (∀t ) ≤ y [ t = y ∨ P (t , x1 ,..., x n )] ( ∃t ) < y P(t , x1 ,..., x n ) ⇔ (∃t ) ≤ y [α (t = y ) & P (t , x1 ,..., x n )]
26. 26. Bounded Quantification & Primitive Recursiveness
27. 27. Bounded Quantification & Primitive Recursiveness ● ● ● We can now use the results on bounded quantification to show more functions to be primitive recursive Bounded quantification furnishes us iterative tools that we can use to check if a predicate is true for every number in a range or for some number in a range We can also use the negation of a bounded quantified statement to show that there is no number for which some predicate is true
28. 28. Y | X is Primitive Recursive Show that y | x ( y divides x or y is a divisor of x) is primitive recursive
29. 29. Y | X is Primitive Recursive y|x⇔ ( ∃t ) ≤x [ y ⋅ t = x ]
30. 30. prime(x) is Primitive Recursive A number is prime if it is greater than 1 and it has no divisors other than 1 and itself. prime( x) ⇔ x > 1 & ( ∀t ) ≤ x [ t = 1 ∨ t = x ∨ ¬( t | x ) ]
31. 31. List of P.R. Functions So Far These are the functions that we have shown to be p.r. : 1. x + y 9. x = y 2. x ⋅ y 10. x ≤ y 3. x! 11. x < y 4. x y 12. x | y 5. p( x ) 13. prime( x ) 6. x − y  7. x − y 15. lcm( x, y ) 8. α ( x ) . 14. gcd( x, y )
32. 32. Summary of Proofs 1. if P, Q are p.r., then so are ¬P, P ∧ Q, P ∨ Q. 2. if f , g are p.r., then so are their finite summations and products. 3. if we have a set of p.r. functions, we can combine them into if - then - else - if statements that will remain p.r. 4. Bounded sums and products of p.r. functions remain p.r. 5. Bounded quantified p.r. predicates remain p.r.
33. 33. Reading Suggestions ● Ch. 3, Computability, Complexity, and Languages, 2 Edition, by Davis, Weyuker, Sigal nd