![]() |
VOOZH | about |
Whenever we asked to identify whether a language (or problem*) is solvable or not appear very often in the GATE exam. Once the basic ideas are clear and you have practiced enough, these questions become much easier. Depending on how they can be solved, languages are divided into the following types:
A decision problem PPP is said to be decidable if there exists an algorithm (or Turing Machine) that always halts and correctly determines the answer for every input. In other words, the language LLL, consisting of all inputs for which the answer is βyes,β is decidable.
Examples:
A decision problem PPP is said to be undecidable if there is no algorithm or computational procedure that can correctly determine the answer for every possible input. Such problems cannot be solved completely using a mechanical, step-by-step procedure.
Example:
The Halting Problem β Given a program and an input, determine whether the program will halt or run forever. This problem is undecidable.
A decision problem PPP is said to be partially decidable or semi-decidable if there exists a semi-algorithm for it. This means that the language LLL consisting of all βyesβ instances of PPP is recursively enumerable (RE).
A language LLL is called recursive if there exists a Turing Machine that accepts every string belonging to LLL and rejects every string not belonging to LLL. The Turing Machine always halts for every input string and produces a definite result, either accept or reject.
A language LLL is said to be decidable if it is recursive. Hence, all decidable languages are recursive languages, and all recursive languages are decidable.
A language LLL is said to be recursively enumerable if there exists a Turing Machine that accepts and halts for every input string belonging to LLL. For input strings that are not in LLL, the Turing Machine may either reject or run forever without halting.
By definition, every recursive (REC) language is also a recursively enumerable (RE) language, but not every RE language is recursive.
A common way to solve decidability problems is by using reduction, where a problem with known decidability is transformed into another problem. If an undecidable problem P1P_1P1β can be reduced to a problem P2P_2P2β, then P2P_2P2β must also be undecidable. Otherwise, if P2P_2P2β were decidable, P1P_1P1β would also be decidable, which contradicts the fact that P1P_1P1β is undecidable.
1: State Entry Problem
Problem:
Given a Turing Machine M and an input string π€ , determine whether a specific state π is ever reached during the computation of M on π€. This is called the State Entry Problem.
Reduction from the Halting Problem:
A Turing Machine halts when a transition Ξ΄(q i β ,a) is undefined. Modify the machine by replacing every undefined transition with
Thus, the machine reaches state π Q if and only if it would have halted.
If an algorithm existed that always halts and decides whether state Q is reached, it would also decide the Halting Problem. Since the Halting Problem is undecidable, this leads to a contradiction.
Conclusion:
The State Entry Problem is undecidable.
2. Given two regular languages L1 and L2, is the problem of finding whether a string 'w' exists in both L1 and L2, a decidable problem or not.
First we make two Turing machines TM1 and TM2 which simulate the DFAs of languages L1 and L2 respectively. We know that a DFA always halts, so a Turing machine simulating a DFA will also always halt. We enter the string 'w' in TM1 and TM2. Both Turing machines will halt and give us an answer. We can connect the outputs of the Turing machines to a modified 'AND' gate which will output 'yes' only when both the Turing machines answer 'yes'. Otherwise it will output 'no'. Since this system of two Turing machines and a modified AND gate will always stop, this problem is a decidable problem.
There are a lot of questions on this topic. There is no universal algorithm to solve them. Most of the questions require unique and ingenious proofs. Here is where experience is needed. By solving a lot of these problems, one can become very quick in coming up with proofs for these problems on the spot. So, keep practicing. *The words 'language' and 'problem' can be used synonymously in Theory of computation. For e.g. The 'Halting problem' can also be written as 'L = {<M, w> | Turing machine 'M' halts on input 'w'}'. Here 'L' is a language.