Decidability and Undecidability in TOC
Last Updated :
03 Aug, 2023
Identifying languages (or problems*) as decidable, undecidable or partially decidable is a very common question in GATE. With correct knowledge and ample experience, this question becomes very easy to solve. Lets start with some definitions:-
Decidable language -A decision problem P is said to be decidable (i.e., have an algorithm) if the language L of all yes instances to P is decidable. Example-
(I) (Acceptance problem for DFA) Given a DFA does it accept a given word?
(II) (Emptiness problem for DFA) Given a DFA does it accept any word?
(III) (Equivalence problem for DFA) Given two DFAs, do they accept the same language?
Undecidable language -– A decision problem P is said to be undecidable if the language L of all yes instances to P is not decidable or a language is undecidable if it is not decidable. An undecidable language maybe a partially decidable language or something else but not decidable. If a language is not even partially decidable , then there exists no Turing machine for that language.
Partially decidable or Semi-Decidable Language -– A decision problem P is said to be semi-decidable (i.e., have a semi-algorithm) if the language L of all yes instances to P is RE. A language ‘L’ is partially decidable if ‘L’ is a RE but not REC language.
Recursive language(REC) – A 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 not in ‘L’. The Turing machine will halt every time and give an answer(accepted or rejected) for each and every string input. A language ‘L’ is decidable if it is a recursive language. All decidable languages are recursive languages and vice-versa.
Recursively enumerable language(RE) – A language ‘L’ is said to be a recursively enumerable language if there exists a Turing machine which will accept (and therefore halt) for all the input strings which are in ‘L’ but may or may not halt for all input strings which are not in ‘L’. By definition , all REC languages are also RE languages but not all RE languages are REC languages.
Now lets solve some examples – One way to solve decidability problems is by trying to reduce an already known undecidable problem to the given problem. By reducing a problem P1 to P2, we mean that we are trying to solve P1 by using the algorithm used to solve P2. If we can reduce an already known undecidable problem P1 to a given problem P2 , then we can surely say that P2 is also undecidable. If P2 was decidable, then P1 would also be decidable but that becomes a contradiction because P1 is known to be undecidable.
For eg.
1. Given a Turing machine ‘M’, we need to find out whether a state ‘Q’ is ever reached when a string ‘w’ is entered in ‘M’.
This problem is also known as the ‘State Entry problem’.
Now lets try to reduce the Halting problem to the State Entry problem. A Turing machine only halts when a transition function ? (qi , a) is not defined. Change every undefined function ?(qi,a) to ?(qi,a) = (Q, a, L or R). Note that the state Q can only be reached when the Turing machine halts. Suppose we have an algorithm for solving the State Entry problem which will halt every time and tell us whether state Q can be reached or not. By telling us that we can or cannot reach state Q every time, it is telling us that the Turing machine will or will not halt, every time. But we know that is not possible because the halting problem is undecidable. That means that our assumption that there exists an algorithm which solves the State Entry problem and halts and gives us an answer every time, is false. Hence, 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 eg. The ‘Halting problem’ can also be written as ‘L = {<M, w> | Turing machine ‘M’ halts on input ‘w’}’. Here ‘L’ is a language.
This article has been contributed by Nitish Joshi.
Similar Reads
Undecidability and Reducibility in TOC
Decidable Problems A problem is decidable if we can construct a Turing machine which will halt in finite amount of time for every input and give answer as âyesâ or ânoâ. A decidable problem has an algorithm to determine the answer for a given input. Examples Equivalence of two regular languages: Giv
5 min read
Decidability, Semi-Decidability, and Undecidability in TOC
We know about Decidable, Semi-decidable, and Undecidable problems and in this article, we will briefly define these problems and provide the most commonly asked questions on these problems and classify them accordingly. Prerequisite - https://www.geeksforgeeks.org/decidable-and-undecidable-problems-
3 min read
Decidability Table in Theory of Computation
Prerequisite - Undecidability, Decidable and undecidable problems Identifying languages (or problems*) as decidable, undecidable or partially decidable is a very common question in GATE. With correct knowledge and ample experience, this question becomes very easy to solve. A language is undecidable
2 min read
Decidable and Undecidable Problems in Theory of Computation
In the Theory of Computation, problems can be classified into decidable and undecidable categories based on whether they can be solved using an algorithm. A decidable problem is one for which a solution can be found in a finite amount of time, meaning there exists an algorithm that can always provid
6 min read
Difference Between Decidability and Computability
While solving a particular problem it becomes really important for us to figure out if the problem is solvable or not. Determining both computability and decidability is thus very important to figure out if the problem can be solved in a finite amount of time. Even though both of them sound quite si
5 min read
Determining Countability in TOC
Countable Set is a set having cardinality same as that of some subset of N the set of natural numbers . A countable set is the one which is listable. Cardinality of a countable set can be a finite number. For example, B: {1, 5, 4}, |B| = 3, in this case its termed countably finite or the cardinality
3 min read
L-graphs and what they represent in TOC
In Theory of Computation (TOC), Finite Automata (DFA/NFA) are mathematical models used to recognize Regular Languages. However, not all programming languages can be represented using Finite Automata because they require more computational power than what FA can provide. Languages like C, Pascal, Has
4 min read
Halting Problem in Theory of Computation
The halting problem is a fundamental issue in theory and computation. The problem is to determine whether a computer program will halt or run forever. Definition: The Halting Problem asks whether a given program or algorithm will eventually halt (terminate) or continue running indefinitely for a par
4 min read
Turing Machine in TOC
Turing Machines (TM) play a crucial role in the Theory of Computation (TOC). They are abstract computational devices used to explore the limits of what can be computed. Turing Machines help prove that certain languages and problems have no algorithmic solution. Their simplicity makes them an effecti
7 min read
Dovetailing in Turing Machines
In the carpentry industry, dovetailing is a technique of joining two pieces of wood together by interleaving them. Similarly in the case of Turing Machines dovetailing is the technique by which we can simulate multiple Turing Machines, in some cases an infinite number of Turing Machines together. Th
4 min read