Like this presentation? Why not share!

# Theory of Computation: Lecture 16

## on Nov 09, 2011

• 695 views

1) Godel numbering

1) Godel numbering
2) Pairing functions
3) Coding programs by numbers
4) Class home page is at http://vkedco.blogspot.com/2011/08/theory-of-computation-home.html

### Views

Total Views
695
Views on SlideShare
534
Embed Views
161

Likes
0
0
0

### 21 Embeds161

 http://vkedco.blogspot.com 95 http://vkedco.blogspot.in 27 http://vkedco.blogspot.co.il 4 http://vkedco.blogspot.ca 3 http://vkedco.blogspot.co.uk 3 http://vkedco.blogspot.com.es 3 http://vkedco.blogspot.cz 3 http://vkedco.blogspot.mx 3 http://vkedco.blogspot.com.br 3 http://vkedco.blogspot.fr 2 http://vkedco.blogspot.jp 2 http://vkedco.blogspot.nl 2 http://vkedco.blogspot.com.au 2 http://vkedco.blogspot.it 2 http://www.vkedco.blogspot.com 1 http://vkedco.blogspot.tw 1 http://vkedco.blogspot.hu 1 http://vkedco.blogspot.com.ar 1 http://vkedco.blogspot.ie 1 http://vkedco.blogspot.be 1 http://vkedco.blogspot.de 1
More...

### Report content

• Comment goes here.
Are you sure you want to
Your message goes here

## Theory of Computation: Lecture 16Presentation Transcript

• CS 5000: Theory of Computation Lecture 16 Vladimir Kulyukin Department of Computer Science Utah State University
• Outline● Review● Pairing Functions● Gödel Numbers
• Review
• Review: Unbounded MinimalizationLet P ( x1 ,..., x n , t ) be a predicate. The unboundedminimalization of P ( x1 ,..., x n , t ) is defined asg ( x1 ,..., x n , y ) = min P ( x1 ,..., x n , y ). y
• Review: Theorem 7.2 (Ch. 3)If P ( t , x1 ,..., x n ) is a computable predicate andg ( x1 ,..., x n , y ) = min P ( y, x1 ,..., x n ) is partially computable. y
• Review: Bezout’s IdentityIf a and b are integers whose greatestcommon divisor is d , i.e., gcd( a,b ) = d ,then there are integers x and y such thatax + by = d .
• Review: Euclid’s 1st TheoremIf a prime divides the product of two integers, then theprime divides at least one of the two integers. Formally, ifp|ab, then p|a or p|b, where p is a prime and a and b areintegers.
• Review: Fundamental Theorem of ArithmeticEvery positive integer greater than 1 is either a prime orcan be written as a product of primes. The factorization is unique except for the order of factor primes.This theorem is also known as Unique FactorizationTheorem
• Pairing Functions
• Pairing Functions● Pairing functions are coding devices for mapping pairs of natural numbers into single natural numbers and vice versa● Once we have pairing functions we will be in the position to map lists of numbers into single numbers and vice versa● Remember that our end objective is to compile L programs into natural numbers
• Pairing Functions • x, y = 2 ( 2 y + 1) − 1 x •2 ( 2 y + 1) − 1 ≥ 0 x x, y + 1 = 2 ( 2 y + 1) x
• Equation 8.1 (Ch. 3)If z is a a natural number, there is a uniquesolution for x, y to the following equation : x, y = z
• Equation 8.1 (Ch. 3)1. x , y = z2. x, y + 1 = 2 x (2 y + 1).3. z + 1 = 2 x (2 y + 1). { }4. x = max 2 | ( z + 1) . In other words, d dx is the largest number such that 2 x | ( z + 1). z+ 1 −1 z+ 1 x5. 2 y + 1 = x ⇒ y = 2 2 2
• Equation 8.1 (Ch. 3) •Since x, y = z = 2 ( 2 y + 1) − 1, x x, y + 1 = z + 1 = 2 ( 2 y + 1). xTherefore, x < z + 1, y < z + 1.Hence, x ≤ z , y ≤ z.
• Example 1Solve x, y = 10. • x, y = 10 ⇒ 2 ( 2 y + 1) − 1 = 10 ⇒ x2 ( 2 y + 1) = 11 ⇒ x { }x = max 2 | 11 ⇒ x = 0 ⇒ d d2 y + 1 = 11 ⇒ y = 5.Check : 0,5 = 2 ( 2 ⋅ 5 + 1) − 1 = 11 − 1 = 10. 0  
• Example 2Solve x, y = 19. x, y = 2 ( 2 y + 1) − 1 = 19 ⇒ x 2 ( 2 y + 1) = 20 ⇒ x {x = max 2 | 20 = 2 ⇒ d d }2y + 1 = 5 ⇒y = 2.Check : 2,2 = 2 ( 2 ⋅ 2 + 1) − 1 = 20 − 1 = 19. 2  
• Splitting Natural NumbersEquation 8.1 defines two functions : l ( z ) and r ( z ) , z ∈ N . l ( z ) = l ( x, y ) = x. r ( z ) = r ( x, y ) = y.Examples : l (10 ) = l ( 0,5 ) = 0; r (10) = r ( 0,5 ) = 5. l (19 ) = l ( 2,2 ) = 2; r (19) = r ( 2,2 ) = 2.
• Lemmal ( z ) and r ( z ) are primitive recursive.
• ProofIf z ∈ N , then z = x, y , x ≤ z , y ≤ z. Thus,l ( z ) = min[( ∃ y ) ≤ z [ z = x, y ]] x≤ zr ( z ) = min[( ∃ x ) ≤ z [ z = x, y ]] y≤ z
• Theorem 8.1 (Ch. 3)The functions x,y , l ( z ) , r ( z ) have the following properties :1. They are primitive recursive2. l ( x, y ) = x, r ( x, y ) = y3. l ( z ) , r ( z ) = z4. l ( z ) ≤ z , r ( z ) ≤ z
• ProofThis theorem simply summarizes the properties of thepairing function and the splitting functions l(z) and r(z).Properties 2, 3, 4 follow from Equation 8.1. Property 1follows from Equation 8.1 and the bounded minimalizationdefinitions for l(z) and r(z).
• Gödel Numbers
• Kurt Gödel1906 - 1978
• History● Gödel investigated the use of logic and set theory to understand the foundations of mathematics● Gödel developed a technique to convert formal symbolic statements into natural numbers● The technique was later called Gödel numbering
• Coding Programs by Numbers• Programming languages are symbolic formalisms• If we can convert statements of symbolic formalisms into numbers [in other words, any program P is associated with a unique number #(P)], we have the foundations of a mathematical theory of program compilation and program execution (interpretation)• The gist of the theory is three-fold: 1. Given a program P, there is a computable function C such that C(P) = #(P); this is the compiler 2. Given #(P), there is a computable function RC such that RC(#(P))= P; this function is the reverse compiler 3. Given a program P, there is a partially computable function V that can execute C(P); this is the operating system or the virtual machine
• Gödel NumbersLet ( a1 ,..., an ) be a sequence of numbers. nWe define [ a1 ,..., an ] = ∏ ai p , where pi is the i - th prime. i i= 1[a1 ,..., an ] is the Gödel number (G-number) of this sequence.
• Example 3Suppose we have the following sequence (1,3,2 ).The G - number of this sequence is[1,3,2] = p ⋅ p ⋅ p = 2 ⋅3 ⋅5 . 1 1 3 2 2 3 1 3 2
• Reading Suggestions nd● Ch. 3, Computability, Complexity, and Languages, 2 Edition, by Davis, Weyuker, Sigal● http://en.wikipedia.org/wiki/Kurt_Gödel