Reductions and Undecidability
Learn how reducing a problem into a simpler problem can help us solve the complex problem easily.
The membership problem
Let’s now consider the membership problem, which determines whether a given string is in a given language. For regular languages, we just run the string through the machine’s DFA to see if it is accepted. For context-free languages, we can use the CYK algorithm to see if the string is generated by a given CFG. For recursively enumerable languages, we want an algorithm, (for “accept”), that, given any Turing machine , and any string , will determine whether accepts . Again, we doubt this is possible, since not all s halt. What would be the consequences of the existence of such an algorithm, ? In essence, it would mean that all recursively enumerable languages are recursive, since would decide all s with an input arbitrary string. But we know that some recursively enumerable languages are not recursive (contradiction!), so cannot exist.
Note: The membership problem is undecidable.
This is a very strong result. This means that the membership problem characterizes RE languages. In other words, is “reducible” to any other RE language’s . Such languages are called RE-complete.
Knowing now that the membership problem is undecidable, suppose for the moment that we didn’t know that the halting problem was undecidable. We can show that the halting problem, , is undecidable by reducing the membership problem, , to . In other words, we can show that if is decidable, then so is —a contradiction. Consider the program (or, by the Church-Turing Thesis, the “Turing machine”) below:
def R(M,w):if H(M,w):return M(w)else:return False
In this program, we assume that an algorithm for the halting problem, , exists. If indicates that halts on (i.e., it returns True
), then just executes on to determine whether it accepts or not. On the other hand, if indicates that does not halt on , then can’t accept , so rejects it. The algorithm decides the membership problem, which we know is undecidable (contradiction!)—therefore, the halting problem must also be undecidable. We have reduced ...