






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







A function is said to be computable if it can be solved algorithmically. We consider functions defined on NU{0} = N Let f: Nm^ → Nn i. f is said to be total if the domain is the entire Nm ii. f is said to be partial if the domain is a subset of Nm Example: a) f(x) = x^2 - 4 over N Not defined for all natural numbers N b) f(x) = x+1 over N It is defined for all natural numbers so it is total c) f(x) = x/2 over N It is defined for all natural numbers divisible by 2 d) f(x) = x^2 over N It is defined for all natural numbers so it is total Let f be function which is computable, then
Example Design a TM that adds two positive integers. Solution: Let f: N^2 → N be given by f (n 1 , n 2 ) = n 1 + n 2
Initial configuration
1) Zero function (Z) [zeta] Z: NM^ → Nn^ is defined by Z (x) = 0 E.g. Z (1) = 0 Z (1 , 2) = ( 0 , 0 ) Z (10 , 0 , 100) = (0 , 0 , 0) Hence Z is a computable function
3) Projection function ( ) [pie] nm : NM^ → N is given by nm (x 1 , x 2 , x 3 ……..xm…………xn) = xm E.g. ^32 (1 , 0 , 2) = 0 ^41 (10 , 1 , 3 , 2) = 10 11 (2) = 2 Hence is a computable function
B 1 1 1 …… 1 x 1 1 …. 1 B n 1 n 2
Definition: A primitive recursion function is a function that is an initial function or obtained from the initial function by a sequence of operations combinations, composition or primitive recursion. Example
= h (x , y , plus (x,y))
Hence, plus (x,0) = ^21 (x,0) = g(x)
Hence plus is primitive recursion E.g. plus (2,3) = 5 plus (2,0) = ^21 (2,0) = 2 plus (2,2+1) = plus (2,3) = h (2,2, plus (2,2)) → plus (2,2) = plus (2,1+1)=h(2,1, plus (2,1) ) → plus (2,1) = Plus (2,0+1)=h(2,0, plus (2,0) ) → plus (2,0) = 2 (given above)
(It Continue...)
Hence, Knm is primitive recursive
m
Let g: Nn+1^ → N be a computable function Let f: Nn^ → N be constructed from g as follows f(x) = min {y | g (x,y) is true}
The minimalization technique produces a partial function. Suppose g: N^2 → N by g (x,y) = plus (x,y) By minimalization : f: N → N is given by
f(0) = g(0,y) = 0 ( i.e 0+y = 0, y = 0 ) f(1) = undefined f(2) = undefined 0, if x = 0 Undefined, for x> Supose g: N^2 → N by g(x,y) = monus (x,y) By minimalization f: N → N by
f(0) = 0 f(1) = 1 (It Continue…) f(x) = x Definition: A partial primitive recursive is either an initial function or obtained from the initial by operations of combination, composition, primitive recursion or minimalization.
f(x) =
Let f: Nm^ → Nn^ be a function f(x 1 ,x 2 , ………… xm) = (y 1 ,y 2 , ………… yn) To representation (x 1 ,x 2 , ………… xm) on TM’s tape: Bx 1 Bx 2 Bx 3 B…………………..BxmB (x,y,z) = BxByBzB = B x B y B z B f(x,y,z) = (v 1 ,v 2 ,v 3 ) BxByBzB |▬* Bv 1 Bv 2 Bv 3 B We say f is Turing computable if there exist a TM such that the following holds: If f(x 1 ,x 2 , ………… xm) = (y 1 ,y 2 , ………… yn) then TM’s halting configuration Bx 1 Bx 2 Bx 3 B……….BxmB |▬* By 1 By 2 B……….BynB Theorem Every partial primitive recursive function is Turing computable. Proof: 1- Initial function i. Z: N → N is defined by Z(x) = 0
Find a TM that computes Z: Solution: Bx B |▬* B0 B is done by →LOR
Solution:
Represent n by unary notation n = 111111111 ……… 11 B
B111111111…….. 1 B |▬ B111111111…….. 1 B n^ n + 1
n
iii. Primitive Recursion Let f(x,0) = g(x) f(x,y+1) = h(x,y,f(x,y)) Let g and h be partial computable function such that M 1 and M 2 compute g and h respectively WTS f is computable f is Turing computable, Э a TM M 3 that proceeds as follows a) If the last argument of f is 0, then M 3 simulates M 1 and halts. b) If the last argument is non-zero: f(x, y+1). Then arrange the input as follows BxByBxBy-1BxBy-2B……….BxB1BxB0BxB and simulate M 1 The result is BxByB……….BxBOBg(x)B which is equivalent to BxByB……… B xB0Bf(x,0)B c) Put the head as indicated above and simulate M 2 Result: BxByB……….. BxB1Bh(x, 0, f(x, 0))B Equivalent to BxByB…………… B xB1Bf(x, 1) d) Put the head as indicated above and simulates M 2 Result: BxByB…………..BxB2Bh(x, 1, f(x, 1))B Equivalent to BxByB……….… B xB2Bf(x, 2)B e) Repeat the above process to the remaining part of the tape and simulate M 2 until the tape content contains BxByBf(x, y) Equivalent to h(x, y, f(x, y)) → f(x, y+1) Hence, f is Computable iv. Minimalization Let g be a partial computable function that is computed by TM M 1
WTS f is computable Let M 2 be a TM that is compute f: Construction: M 2 has 3 Tape Tape1: Contains the input x Tape2: Contains the value of ys starting from 0 Tape3: Simulate M 1
Step1: M 2 initializes Tape 2 with 0 Step2: M 2 copies x onto Tape 3 followed by content of Tape 2. Step3: Simulate M 1 on Tape 3. If the result is 0 then done, else erase Tape 3, increment the content of Tape 2 by 1, start from step 2 above. Thus Minimalization is Computable
Definition: Universal Turing Machine (Mu) is a machine that given an input the description of any TM M, can simulate M on W. Construction of Mu We encode the TM M using the following: