Sub topic 15
Decidable and Undecidable Problems Across Language Classes
Assume you know finite automata, context-free grammars, pushdown automata, countability, and proof by contradiction. The key question is whether an algorithm can always halt with the correct answer for a problem about a language or machine.
The language class matters
A decision problem may be easy for one language class and impossible for another. Also distinguish a problem about a particular language from a problem about an encoded machine. For example, membership for a given DFA is decidable. Asking whether an arbitrary Turing machine accepts a given string is undecidable.
| Language or machine description | Membership | Important problems |
|---|---|---|
| Regular language, given by DFA/NFA | Decidable | Emptiness, finiteness, equivalence, and inclusion are decidable |
| Context-free language, given by CFG/PDA | Decidable | Emptiness and finiteness are decidable; equivalence and universality are undecidable |
| Recursive language, given by a decider | Decidable | General semantic properties of the decider can be undecidable |
| Recursively enumerable language, given by a TM | Semi-decidable | Membership is semi-decidable; many global properties are undecidable |
A language is recursive, or decidable, when some Turing machine halts on every input and answers membership correctly. A language is recursively enumerable (RE) when a machine accepts every member, but may run forever on a nonmember. Therefore every recursive language is RE, but not every RE language is recursive.
Standard classifications
For regular languages, algorithms can explore all states of an automaton. Thus DFA or NFA emptiness, equivalence, inclusion, and finiteness are decidable. Equivalence can be tested by checking whether the symmetric difference of two languages is empty.
For context-free languages, membership is decidable using algorithms such as CYK. Emptiness is also decidable because useless variables can be removed. However, equivalence, inclusion, and universality for CFGs are undecidable. A pushdown automaton has more memory than a finite automaton, but it still cannot support every comparison needed by these problems.
For arbitrary Turing machines, the situation changes sharply:
A_TM = {⟨M, w⟩ | M accepts w}is undecidable but RE.- Whether
L(M)is empty is undecidable. - Whether two machines accept the same language is undecidable.
- Whether a machine accepts every string is undecidable.
These results usually follow from reductions or Rice's theorem. Rice's theorem applies to every nontrivial property of the language recognized by a Turing machine. “Nontrivial” means that some machines have the property and some do not.
GATE decision checklist
When classifying a statement:
- Identify the representation: DFA, CFG, decider, or arbitrary TM.
- Ask whether the input is one string or a property of an entire language.
- Look for a known algorithm for regular or context-free languages.
- For arbitrary TMs, test for
A_TM, the halting problem, a reduction, or Rice's theorem. - Do not infer decidability merely because every individual language in the class has a machine.
Exercise
Is equivalence of two DFAs decidable, and is equivalence of two arbitrary TMs decidable?
Show answer
DFA equivalence is decidable by testing whether their symmetric difference is empty. Equivalence of arbitrary TMs is undecidable.