Chapter 11. Universal Turing Machine and Decidability
In this chapter, we consider universal turing machine (TM), the halting problem, and the concept of undecidability.
11.1. Encoding and Enumeration of Turing Machines
The TM is specified by a 6-tuple M = (K, Σ, Γ, δ, q0, F) (refer Definition 9.1). in Γ is a special symbol. The TM can be encoded as a binary string. Without loss of generality, we can take the state set as (q1,q2, ..., qs} where q1 is the initial state and q2 is the final state. The tape symbol set can be taken as {,0,1}. A move of the TM is represented as:
δ(qi, Xj) = (qk, Xr, dl)
11.2. Recursive and Recursively Enumerable Sets
We have seen that the language accepted by a TM is a
type 0 language. It is also called a recursively enumerable (RE) set. A
TM accepts a string by going to a final state and halting. It can reject
a string by halting in a non-final state or getting into a loop. A TM
when started on an input may get into a loop and never halt.
We have also seen that a TM corresponds to an
effective procedure. An effective procedure is one where at each step,
the next step is specified. An effective procedure need not halt. For
example,
11.3. Universal Turing Machine
A Universal TM is a TM which can simulate any other TM including itself. Let us denote a universal TM by U. Without loss of generality, we are considering TMs with tape alphabets {0,1,}. The encoding of such a TM T is a binary string dT. U has three tapes. The first tape is presented with dT t; i.e., the encoding of T and the input t to T. It will be of the form:
111 | ... | 11 | ... | ... | 111 t | ... |
11.4. Problems, Instances, and Languages
A
decision problem is a problem for which the answer is ‘yes’ or ‘no.’
For example, satisfiability problem means to find out whether a Boolean
expression is satisfiable or not. We call this as SAT. Also AMB is the
ambiguity problem for CFG – i.e., finding out whether a CFG is ambiguous
or not. A particular CFG is an instance of the problem. If this
particular CFG G is ambiguous, it is an
‘yes’ instance of the problem. If it is not ambiguous, it is a ‘no’
instance of the problem. Similarly, a particular Boolean expression is
an instance of SAT problem. If it is satisfiable, it is an ‘yes’
instance of the problem. If it is not satisfiable, it is a ‘no’ instance
of the problem. In contrast to these problems, problems like finding a
Hamiltonian circuit in a graph are called optimization problems. Whether
a graph has a Hamiltonian circuit or not is a decision problem. Finding
one is an optimization problem. We shall consider more of this concept
in the next chapter.
Any instance of a problem can be encoded as a string. A Boolean expression can be looked at as a string. For example, (x1 + x2)(1 + 2) can be written as (x1 + x2)(¬ x1 + ¬ x2) – a string from the alphabet {(,), x, +, ¬, 0,1,..., 9}. A CFG G = (N, T, P, S) can be looked at as a string over N∪T∪{(,), {,}, →,}. For example, the grammar ({S}, {a, b}, P, S) where P consists of S → aSb, S → ab can be looked at as a string ({S}, {a, b}, {S → aSb, S → ab}, S).
It is to be noted that generally integers are represented as decimal or
binary and not as unary. The problem can be re-formulated as one
recognizing the language consisting of the ‘yes’ instances of the
problem.
11.5. Rice’s Theorem
Let us recall that a language accepted by a TM is
called a recursively enumerable (RE) language. Without loss of
generality we consider TMs over the input alphabet {0, 1} and tape
alphabet {0,1,}.
Let F be a set of RE languages. Each language is over the alphabets {0, 1}. F is said to be a property of the RE languages. A language L has the property F, if L ∊ F. For example, F may denote the set {L|L is recursive}. F is a trivial property if F is empty or F contains all RE languages. Let LF denote the set {dM|L(M) is in F} where M is a TM, L(M) is the language accepted by it and dM is the encoding of M.
11.6. Reduction of Problems to Show Undecidability
In the last section, we have shown that any
non-trivial problem of RE sets is undecidable. This theorem helps to
prove many problems to be undecidable. Consider the problem: ‘Will a TM
started on a blank tape halt?’ This is equivalent to the problem does ε ∊ T(M)?
and hence undecidable by Rice’s theorem. But for problems about TMs,
there is no simple theorem which can be applied. Each problem has to be
looked at separately.
Example 11.1.
Consider the question, “Does machine T ever print the symbol S0 when started on tape t?” This is undecidable. There does not exist a TM which will take dTt as input and say whether the symbol S0 will be printed or not, for all (T, t).
For, we may take each machine T which does not ordinarily use the symbol S0 and alter the machine so that before it halts, ‘it prints S0
and halts.’ Then, the ‘printing problem’ for the new machine is the
same as the halting problem for the old machine. Since any machine that
does use S0 can first be converted to one that does not (by renaming S0)
and then altered as above, solution of the printing problem would give
solution to all halting problems, and we know that this cannot be done.
11.7. Post’s Correspondence Problem
Definition 11.1
Given two ordered sets of strings w1,... ,wk and x1,..., xk over Σ, is it possible to find integers i1,... ,in, 1 ≤ ij ≤ k such that wi1 ... win = xi1 ... xin? This is called Post’s Correspondence Problem (PCP). If integers i1,... ,in
can be found, for an instance of a problem, that instance of PCP has a
solution. If no such integers can be found, then that instance does not
have a solution.
|
11.8. Computable Functions
In an earlier chapter, we have looked at a TM as a computing device. It computes a function. The TM M starts with input 1n. It halts in an accepting state ha and at that time if the contents of the tape is 1f(n), if f is defined at n. It halts at a non-accepting state or goes into a loop if f(n) is not defined at n. The partial function f is computed by M.
A function which can be computed by a TM is called a Turing computable
function. Here, we are restricting ourselves where the domain and range
of the functions are tuples of integers. The focus on numerical function
values is not as restrictive as it might sound, because any function
from strings to strings can be described by encoding both arguments and
values of the function as numbers.
Primitive Recursive Function
Definition 11.3 (Initial Functions)
The initial functions are the following:
|
Problems and Solutions
1. | Which of the following properties of RE sets are themselves RE?
|
Solution. |
|
2. | Which of the following decision problems are decidable?
Let Ti denote the ith TM.
|
Solution. |
|
3. | Fermat’s last theorem, until recently one of the most-famous unproved statements in mathematics, asserts that there are no integer solution (x, y, z, n) to the equation xn + yn = zn satisfying x, y > 0 and n > 2. Show how a solution to the halting problem would allow you to determine the truth or falsity of the statement. |
Solution. | Suppose the halting problem is decidable. Construct a TM T which will solve Fermat’s last theorem as follows:
TM T has four tapes. In tape T1, it systematically generates ordered quadruples (x, y, z, n), x ≥ 1, y ≥ 1, z ≥ 1, n ≥ 3. Initial one is (1, 1, 1, 3).
In T2, it computes xn + yn.
In T3, it computes zn.
It compares contexts of T2 and T3 and if they match, outputs ‘yes’ in T4. If there is no match, next quadruple is generated in T1 and the process repeats. If there is no solution for Fermat’s last theorem, T will not halt and will go on forever. Now if ‘Halt’ is the algorithm for the halting problem, give T
and the first quadruple as input. If ‘Halt’ says ‘yes’, then Fermat’s
last theorem has a solution. If ‘Halt’ says ‘no’, then Fermat’s last
theorem has no solution.
|
No comments:
Post a Comment