Your SlideShare is downloading. ×
Theory of Computation: Lecture 09
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Theory of Computation: Lecture 09

1,298
views

Published on

1) Primitive recursively closed classes of functions …

1) Primitive recursively closed classes of functions
2) Computable functions are a primitive recursively closed class
3) Primitive recursive functions
4) Showing functions to be primitive recursive
5) Class home page is at http://vkedco.blogspot.com/2011/08/theory-of-computation-home.html

Published in: Education, Technology, Spiritual

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,298
On Slideshare
0
From Embeds
0
Number of Embeds
16
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CS 5000: Theory of Computation Lecture 09 Vladimir Kulyukin Department of Computer Science Utah State University
  • 2. Outline● Review● Primitive Recursively Closed Function Classes● Computable Functions are a Primitive Recursively Closed Function Class● Primitive Recursive Functions● Showing a Function to be Primitive Recursive
  • 3. Review
  • 4. Review: CompositionLet f be a function of k variables.Let g1 ,..., g k be functions of n variables.Leth( x1 ,..., xn ) = f ( g1 ( x1 ,..., xn ) ,..., g k ( x1 ,..., xn ) ) ,Then h is obtained from f and g1 ,..., g k bycomposition.
  • 5. Review: Theorem 1.1 (Ch. 3)If h is obtained from the (partially) computable functions f,g1, …, gk by composition, then h is (partially) computable.
  • 6. Review: Recursion (Definition 1)Suppose k is some fixed number. Let g ( x, y ) be a total function.Let h be obtained from g as follows :h(0) = kh(t + 1) = g (t , h(t ))Then h is obtained from g by primitive recursion (recursion).
  • 7. Review: Theorem 2.1 (Ch. 3)Let h be obtained from g by primitive recursionaccording to Recursion Definition 1. Let g becomputable. Then h is computable.
  • 8. Review: Recursion (Definition 2)Suppose that f and g are total functions of n and n + 2 variables,respectively. Let h be a function of n + 1 variables obtained fromf and g as follows :h( x1 ,..., xn ,0) = f ( x1 ,..., xn )h( x1 ,..., xn , t + 1) = g (t , h( x1 ,..., xn , t ), x1 ,..., xn ).Then h is said to be obtained from f and g by primitive recursion.
  • 9. Review: Theorem 2.2 (Ch. 3)Let h be obtained from f and g by primitive recursionand let f and g be computable. Then h is computable.
  • 10. A Perspective on Primitive Recursion● Primitive recursion is another method that, like composition, allows us to construct new functions from existing functions● Does it capture the notion of computability completely?● The answer is – no, because there are computable functions that cannot be defined via composition or primitive recursion
  • 11. Primitives in Formal Systems● Any formal system (e.g. Euclidian geometry, number theory, etc.) must state its primitives, i.e. elements that cannot be decomposed any further.● Examples: – Points in Euclidean geometry; – Numbers in mathematics; – Assembly operations in compilers; – Primitive instructions in L.
  • 12. Primitive Recursively Closed Classes of Functions
  • 13. Theory of Primitive Recursive Functions● Theory of primitive recursive functions also has its primitives: they are called initial functions● They are called primitives because they are undefinable (unbreakable into further primitives)● It is of these primitives that we can effectively construct more complicated functions through composition and primitive recursion
  • 14. Initial Functions1. The successor function : s( x) = x + 12. The null function : n( x) = 03. The projection function : u ( x1 ,..., xn ) = xi ,1 ≤ i ≤ n n i
  • 15. Primitive Recursively Closed● We can now apply the notion of mathematical closure to classes of functions● A class of total functions C is a primitive recursively closed (PRC) class if – The initial functions are in C – Any function obtained from the functions already in C by composition or primitive recursion is also in C
  • 16. Theorem 3.1 (Ch. 3)The class of computable functions is PRC
  • 17. Proof 3.1• There are two parts to this proof: 1. The initial functions are computable so they satisfy the first condition of the PRC definition 2. We can use theorems 1.1 (Ch. 3), 2.1 (Ch. 3), and 2.2 (Ch. 3) to show that any function that is obtained from the initial functions through composition, primitive recursion, or any combination thereof also computable: in other words, composition, primitive recursion, and any combination thereof preserves computability
  • 18. Proof 3.1: Part 1Initial Function : s ( x) = x + 1L - Program : Y ← X 1 + 1Initial Function : n( x) = 0L - Program : ∅Initial Function : uin ( x1 ,..., xn )L - Program : Y ← X i
  • 19. Proof 3.1: Part 2● Theorem 1.1 (Ch. 3) ensures that any function obtained by composition of computable functions is computable● Theorems 2.1 (Ch. 3) and 2.2 (Ch. 3) ensure that any function obtained by recursion from another computable function is also computable● Therefore, any finite sequence of compositions and recursions applied to computable functions leads to a computable function (this can be formalized with an inductive proof)
  • 20. Primitive Recursive Functions
  • 21. Definition: Primitive Recursive FunctionA function is called primitive recursive if it can be obtainedfrom the initial functions (successor, null constant, andprojection) by a finite number of applications of compositionor recursion
  • 22. Terminology Caveat 1● We should distinguish the definitions of primitive recursion and primitive recursive function● Primitive Recursion defines a method through which functions are constructed from existing functions● Primitive Recursive Function defines function that has a specific property (it can be constructed by a finite number of applications of composition and primitive recursion to the three initial functions)
  • 23. Terminology Caveat 2● We should also distinguish the definitions of primitive recursively closed and primitive recursive● Primitive recursive closed applies to classes of functions that satisfy two properties in the definition of the PRC class● Primitive recursive applies to individual functions that have a specific property in the definition of primitive recursive function
  • 24. Simple Insight● The definition of primitive recursive function has a constructive interpretation● If f is a primitive recursive function, there is a list of functions f1, …, fn, where fn = f and every function fi in the list is either an initial function or is obtained from the preceding functions in the list by composition or recursion
  • 25. QuestionHow can we show that a function is primitive recursive?
  • 26. An Answer There are two strategies:1. Obtain the function from the initial functions through composition or primitive recursion (first principles reasoning that works on fairly simple functions)2. Use the knowledge that some functions are already primitive recursive in combination with composition or primitive recursion (this is a more generic method)
  • 27. Example 1Show that f(x,y) = x + y is primitive recursive
  • 28. Example 1● Here are the recurrences from Definition 2 of primitive recursion: – f(x, 0) = x – f(x, t+1) = f(x, t) + 1● Let us play with these recurrences: – f(2, 0) = 2. Works! – f(2, 1) = f(2, 0) + 1 = 2 + 1 = 3. Works! – f(3, 2) = f(3, 1) + 1 = f(3, 0) + 1 + 1 = 3 + 1 + 1 = 5. Works!
  • 29. Example 1: Using Formal DefinitionBase Case :f ( x,0 ) = x becomes h( x,0 ) = u ( x,0 ) 2 1
  • 30. Example 1: Using Formal DefinitionRecursive Case :f ( x, t + 1) = f ( x, t ) + 1 becomes ( )h( x, t + 1) = s u ( t , h( x, t ) , x ) . 3 2Or, more formally,h( x, t + 1) = g ( t , h( x, t ) , x ) , where (g ( x1 , x 2 , x3 ) = s u ( x1 , x 2 , x3 ) 3 2 )
  • 31. Example 1: Using Formal DefinitionCombining the base and recursive cases, we get :h ( x ,0 ) = u ( x ,0 ) 2 1h( x, t + 1) = g ( t , h( x, t ) , x ) , where (g ( x1 , x 2 , x3 ) = s u ( x1 , x 2 , x3 ) 3 2 )
  • 32. Reading Suggestions nd● Ch. 3, Computability, Complexity, and Languages, 2 Edition, by Davis, Weyuker, Sigal
  • 33. FeedbackErrors, comments to vladimir.kulyukin@gmail.com