Professional Documents
Culture Documents
11) A)
B) Define ε-closure of a state and explain with a suitable example.
14) A) Construct a TM to accept the language of palindromes over the alphabet {a, b}.
B) Explain Halting problem of a TM.
The HaltingProblem states that it is impossible to write a program that runs in finite time that is
able to decide whether an arbitrary program will halt (with a certain input).
The HaltingProblem does not state that it is impossible to decide for a specific program whether
it is going to halt. It is even possible to write programs that make this decision. They simply
work only on a subset of all programs.
To be correct about terms, the HaltingProblem is actually the question, "Given this code
X, will it terminate (halt)?". Usually the only reason to ask this formulated in such a way
is to give an example of a problem for which there is no recursive enumerable algorithm,
i.e. an algorithm that will itself always produce a result.
Here is the proof of the HaltingProblem:
Assume I have a program P that can tell you whether any program halts or not for given
input data.
I construct a program Q based on P which, if P says its input program doesn't halt,
immediately halts, and if P says the program halts, goes into an infinite loop.
Feeding Q(Q) to P I can see that if P says it halts, it won't, and if P says it doesn't halt, it
will.
Therefore I don't have any such program P and anyone else who says they do is full of it.