Chapter-II Enumerators: Universal Turing Machine
Chapter-II Enumerators: Universal Turing Machine
ENUMERATORS
An enumerator is a Turing machine with an attached printer. The Turing machine can use that
printer as an output device to print strings. Every time the Turing machine wants to add a
string to the list, it sends the string to the printer.
An enumerator E starts with a blank input on its work tape. If the enumerator doesn’t halt, it
may print an infinite list of strings. The language enumerated by E is the collection of all the
strings that it eventually prints out. Moreover, E may generate the strings of the language in
any order, possibly with repetitions. Now we are ready to develop the connection between
enumerators and Turing recognizable languages.
States of the TM are Q={q0,q1,qf },States can be coded as Q0=0 Q1=00 Qf=000,
Tape symbols are Γ={a,b,,#},Tape symbols can be coded a=0,b=00,#=000
in the coding of TM, TM end with 111, transition functions are separator by 11.
State, tape symbol and direction are separator by 1.
Completed TM is 0101010100110100101001001101000100100010110010
01000100100111.
Let w=abbb be the string to be checked on the TM, M. the input UTM willbe,
0101100100100110100010010000101100100010001000
01001100010000100001000001001100001000101000010111abbb
UTM uses the binary code of the Turing machine ,M on string abbb and will
check. if true UTM will halt to say yes and if false UTM will stop to say no.
Godelization:
In this chapter, we will learn about the decidability and undecidability. In order understand
above mentioned terms the following definition needs to know.
Recursive language
The language L is said to be recursive if there exists a Turing machine,which will accept all
the strings in ‘L’ and reject all the strings are not in ‘L’.The turing machine will halt every
time and give an answer(accepted or rejected) for each and every string input.
The language L is said to be recursively enumerable language if there exists a Turing machine
(and therefore halt), which will accept all the input strings which are in ‘L’. But may or may
not halt for all input strings which are not in L
Decidable Language
A language ‘L’ is decidable if it is a recursive language. All decidable languages are recursive
language and vice versa.
Undecidable Language
The above definitions are given in below table for quick understating.
A language is called Decidable or Recursive if there is a Turing machine which accepts and
halts on every input string w. Every decidable language is Turing-Acceptable.
A decision problem P is decidable if the language L of all yes instances to P is decidable. For
a decidable language, for each input string, the TM halts either at the accept or the reject state
as depicted in the following diagram:
Example 1
Find out whether the following problem is decidable or not:
Is a number ‘m’ prime?
Solution
Prime numbers = {2, 3, 5, 7, 11, 13, …………..}
Divide the number ‘m’ by all the numbers between ‘2’ and ‘√m’ starting from ‘2’.If any of
these numbers produce a remainder zero, then it goes to the “Rejected state”, otherwise it
goes to the “Accepted state”. So, here the answer could be made by ‘Yes’ or ‘No’.
Hence, it is a decidable problem.
Example 2
Given a regular language L and string w, how can we check if w∈ L?
Solution
Take the DFA that accepts L and check if w is accepted
Note:
1. If a language L is decidable, then its complement L' is also decidable.
2. If a language is decidable, then there is an enumerator for it.
Note:
1. If a language L is decidable, then its complement L' is also decidable.
2. If a language is decidable, then there is an enumerator for it.
The acceptance problem for DFAs of testing whether a particular deterministic finite
automaton accepts a given string can be expressed as a language, ADFA. This language
contains the encodings of all DFAs together with strings that the DFAs accept. Let
ADFA = { < B, w > | B is a DFA that accept s input string w }.
The problem of testing whether a DFA B accepts an input w is the same as the problem of
testing whether a <B,w> is a member of the language ADFA. Similarly we can formulate other
computational problem in terms of testing membership in a language.
In the following theorem we show that ADFA is decidable. Hence this theorem shows that the
problem of testing whether a given finite automaton accepts a given string is decidable.
Theorem 1.
ADFA is decidable language.
Proof Idea: we simply need to present a TM M that decides ADFA.
M= “ On input <B,w>, where B is DFA and w is a string.
1. Simulate B on input w.
2. If the simulation ends in an accept state, accept. If it ends in a non accepting state,
reject.”
Let’s examine the input <B,w>. it is a representation of a DFA B together with a string w.
one reasonable representation of B is simply a list of its five components, Q,,δ,q0 and F.
when M receives its input, M first determines whether it properly represents a DFA B and a
string w. if not, M rejects.
Then M carries out the simulation directly. It keeps track of B’s current state and B’s current
position in the input w by writing this information on the tape. Initially, B’s current state is q 0
and B’s current input position is the leftmost symbol of w. The states and position are
updated according to the specified transition function δ. When M finishes the last symbol of
w, M accepts the input if B is in an accepting state; M reject the input if B is in a non-
accepting state.
We can prove similar theorem for nondeterministic finite automata. Let
ANFA = {< B, w > | B is a NFA that accept s input string w }.
Theorem 2.
ANFA is decidable language.
PROOF: we present a TM N that decides A NFA. We could design N to operate like M,
simulating an NFA instead of a DFA. Instead, we will do it differently to illustrate a new idea
have N use M as a subroutine. Because M is designed to work with DFA. N first converts the
NFA it receives as input to a DFA before passing it to M.
N= “On input <B,w> where B is a NFA and w is a string
1. Convert NFA B to an equivalent DFA C by using the procedure for this conversion.
2. Run TM M from Theorem 1 on input <C,w>.
3. If M is accepts, then string w is accepted. Otherwise rejected”.
Similarly, we can determine whether a regular expression generates a given string.
Let AREX = {<R,w> R is a regular expression that generates string w}.
Theorem 3.
AREX is decidable language.
PROOF: The following TM P decides AREX.
P=”On input <R,w> where R is a regular expression and w is a string.
1. Convert regular expression R to equivalent NFA A by using the procedure for this
conversion.
2. Run TM N on input <A,w>.
3. If N is accepts, then string w is accepted. Otherwise rejected”.
Theorem 1, 2 and 3 illustrate that, for decidability purposes, presenting the Turing machine
with DFA, NFA, or regular expression are all equivalent because the machine is able to
convert one form to another.
Now we turn to a different kind of problem concerning finite automata: emptiness testing for
the language of a finite automaton. In the preceding three theorems we had to determine
whether a finite automaton accepts a particular string. In the next proof we must determine
whether a finite automaton accepts any string at all.
Theorem 4.
EDFA is decidable language.
PROOF: A DFA accepts some string iff reaching an accepts state from the start state by
travelling along the arrows of a DFA is possible. To Test is condition we design a TM T that
uses a marking algorithm.
T=”On input <A> where A is a DFA.
1. Mark the start state of A.
2. Repeat until no new states get marked.
3. Mark any state that has a transition coming into it from any state that is already
marked.
4. If no accept state is marked, accept; otherwise reject”.
The next theorem states that determining whether two DFAs recognize the same language is
decidable. Let
Theorem 5.
EQDFA = {<A,B>| A and B are DFAs and L(A) = L(B)}.
PROOF: we convert a new DFA C from A and B, Where C accepts only those strings that are
accepted by either a or B not by both. Thus, A and B recognize the same language, C will
accept nothing. The language of C is
This expression is some time called the symmetric different of L(A) and L(B) and illustrate in
the following figure. Here L(A)1 is the complement of L(A). The symmetric different is
useful here because L(C)=Ø iff L(A)=L(B).
We constructed C from the theorem 4 to test whether L(C) is empty. If it is empty, L(A) and
L(B) must be equal.
F=”On input <A,B>, where A and B are DFAs.
1. Construct DFA C as described.
2. Rum TM T from Theorem 4 on input <C>.
3. If T is accepts, accept. If T rejects, reject.”
Rice Theorem
Rice’s theorem states that, every non-trivial property of a recursively enumerable language is
undecidable.
Proof -A non-trivial property is one that is possessed by some objects of a class, but not all.
For example, being a mathematician is a property that is possessed by some humans but not
by all. Some cats are black but not all. So black colour property cannot be trivially
associated with cats.
Let χ be a non-trivial property that is not posse,ssed by all recursively enumerable
languages. This problem can be reduced to one consisting of a pair (M, w) such that L
possesses χ iff w ∈ L(M ). We take a UTM U that takes a pair (M, w); its output is yes iff χ
is possessed by L.
Since L is a recursively enumerable language, there must be a TM, ML that accepts L. Let
x be a string belonging to L. Now, we design a machine M J to decide χ as shown below:
Here U is a UTM.
UTM, U takes the pair (M, w) and checks if w ∈ L(M ). If the output is yes, then the
machine ML that accepts the string x starts and the output of the machine M J is yes. Thus
the decidability of the problem of possessing the trivial property reduces to the problem
of Lu . If the pair (M, w) ∈ Lu , then L possesses χ ; otherwise not. Since Lu is not
recursive, possession of χ by L is also not decidable.
Let there be two series, x series and y series of size n with same charactere set Σ with
their ith element as xi and yi, respectively; does there exist a solution that forms the same x
series and y series?
The generic solution of PCP can be written as,
xi1 xi2 xi3 xik = yi1 yi2 yi3 yik
Example 1:
Let there be two series of strings, say x series and y series as shown below:
i xi yi
1 10 101
2 01 100
3 0 10
4 100 0
5 1 010
If we take 23,
x string is, x2x3 =010
y string is, y2y3 =10010.
Here x string and ys tring are different. Hence 23 is not a solution to this instance of PCP.
Example 2:
Find the solution to the instance of PCP given in the following table.
i xi yi
1 0 000
2 0100 01
0
3 01 1
Solution,
x2x1x1x3= 010000001
y2y1y1y3= 010000001
Example 3:
Find why the instance of PCP given below cannot have a solution.
i xi yi
1 0 000
2 010 0100
3 01 100
4 11 110
It can be seen that for every pair, |xi| > |yi|.
So, in whatever way we concatenate the string, the length of the x string will be longer
than the corresponding y string. Thus there is no solution for this instance of PCP.