TOC GTU Study Material Presentations Unit-6 18062021085644AM

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Theory of Computation (TOC)

GTU # 3160704

Unit – 6
Computable Functions

Prof. Dixita B. Kagathara


Computer Engineering Department
Darshan Institute of Engineering & Technology, Rajkot
dixita.kagathara@darshan.ac.in
+91 - 97277 47317 (CE Department)
Topics to be covered
 Looping
• Initial functions
• Composition
• Primitive Recursion Operation
• Primitive Recursive Functions
• Bounded Quantifications
• Bounded Minimalization
• Unbounded Minimalization
• μ – Recursive Functions
• Gödel Number of a sequence of Natural Numbers
• Gödel Numbering of strings
• Recursive languages and Recursively enumerable languages
• Halting problem
Initial functions
 The initial function are the following:
1. Constant functions: For each and each , the constant function is defined by the formula
for every
In the case we may identify the function with the number a.
2. The successor function is defined by the formula
3. Projection functions: For each and each with , the projection function is defined by the
formula

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 3
Composition
 Suppose f is a partial function from , and for each with is a partial function from . The partial
function obtained from and by composition is the partial function from defined by the formula

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 4
Primitive Recursion Operation
 Suppose , and and are functions of and variables, respectively. The function obtained from
and by the operation of primitive recursion is the function defined by the formulas

for and every

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 5
Primitive Recursive Functions
 The set PR of primitive recursive functions is defined as follows.
1. All initial functions are elements of PR.
2. For any and , if and are elements of PR, then the function obtained from and by
composition is an element of PR.
3. For any , any function in PR, and any function in PR, the function obtained from g and h
by primitive recursion is in PR.
4. No other functions are in the set PR.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 6
Show that the function f(x, y) = x + y is primitive recursive
 We start with primitive recursive derivation for .
 If is obtained from and by primitive recursion, and must be functions of one and three
variable, respectively
 The equations are:
 

 should be , and thus we may take to be the initial function


 In order to get from the three quantities , we can simply take the successor of .
 In other words, should be
 These means that should be or

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 7
Show that the function f(x, y) = x + y is primitive recursive
 Therefore, a derivation for can be obtained as follow:
(an initial function)
(an initial function)
(an initial function)
(obtained from and by composition)
(obtained from and by composition)
 This way of ordering the five functions is not the only correct one.
 Any ordering in which is last and and both precede would work well.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 8
Bounded Quantifications
 Let be an -place predicate. The bounded existential quantification of is the -place predicate
defined by:
= (there exists with such that is true)
 The bounded universal quantification of is the -place predicate defined by:
= (for every satisfying is true)

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 9
Bounded Minimalization
 For an -place predicate , the bounded minimalization of is the function defined by

min if this set is not empty


otherwise
 The symbol μ is often used for the minimalization operator, and we sometimes write

 An important special case is that in which is for some . In this case is written and referred to
as the bounded minimalization of

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 10
Unbounded Minimalization
 If is an place predicate, the unbounded minimalization of is the partial function defined by

is undefined at any for which there is no satisfying


 The notation is also used for . In the special case in which we write and refer to this function as
the unbounded minimalization of .

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 11
μ – Recursive Functions
 The set of - recursive, or simply recursive, partial functions is defined as follows:
1. Every initial function is an element of .
2. Every function obtained from elements of by composition or primitive recursion is an
element of .
3. For every and every total function in , the function defined by

4. No other functions are in the set .

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 12
Gödel Number of a sequence of Natural Numbers
 For any finite sequence of natural numbers, the Gödel Number of the sequence is the number
,Where is the prime.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 13
Gödel Numbering of strings
 Let be an alphabet with elements

 The Gödel Number of the string 𝜖 * is defined by


1……. m

 The Gödel Number of ^ is defined to be 1.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 14
Recursive languages and Recursively enumerable languages
 A Turing machine with input alphabet accepts a language . decides if computes the
characteristic function A language is recursively enumerable if there is a that accepts , and is
recursive if there is a that decides .

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 15
Halting Problem
 The halting problem of a Turing machine states:
 Given a Turing machine M and an input ω to the machine M, determine if the machine M will eventually halt it
is given input ω.
 Halting problem of a Turing machine is unsolvable.
Proof:
 Moves of a Turing machine can be represented using a binary number. Thus, a Turing machine
can be represented using a string over ε*(0, 1).
 Unsolvable of halting problem of a Turing machine can be proved through the method of
contradiction.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 16
Halting Problem
Step 1:
 Let us assume that the halting problem of a Turing machine is solvable. There exists a machine
H1 (say). H1 takes two inputs:
1. A string describing M.
2. An input ω for machine M.
 H1 generate an output “halt” if H1 determines that M stops on input ω; otherwise H outputs
“loop”. Working of the machine H1 is shown below.

M Halt
H1
W Loop

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 17
Halting Problem
Step 2:
 Let us revise the machine H1 as H2 to take M as both inputs and H2 should be able to
determine if M will halt on M as its input.

M
Halt
H2
Loop

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 18
Halting Problem
Step 3:
 Let us construct a new Turing machine H3 that takes output of H2 as input and does the
following :
1. If the output of H2 is “loop” than H3.
2. If the output of H2 is “halt” than H3 will loop forever.

M
Halt Machine H3 loops forever
H2
Loop Machine H3 halts

 H3 will do the opposite of the output of H2.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 19
Halting Problem
Step 4:
 Let us give H3 itself as inputs to H3.

H3
H3

 If H3 is given as input then H3 would loop.


 If H3 loops forever on H3 as input H3 would halts.
 In either case, the result is wrong.Hence,H3 does not exist.
If H3 does not exist than H2 does not exist.
If H2 does not exist than H1 does not exist.

Prof. Dixita
Jay R Dhamsaniya
B Kagathara #3130006
#3160704 (PS)
(TOC) Unit
Unit
1 –6 Basic
– Computable
Probability
Functions 20
Thank You

You might also like