Lecture 18: Undecidable Problems

- Post's Correspondence Problem (PCP)
- An instance of Post's Correspondence Problem consists of two
lists of strings over some alphabet where the two lists have the same
number of strings.
For example, the pair (
*A*,*B*) where*A*= (*w*_{1},*w*_{2}, ... ,*w*_{k}) and*B*= (*x*_{1},*x*_{2}, ... ,*x*_{k}) is an instance of PCP. - A solution to this instance of PCP, if one exists, is a sequence of one or more integers
*i*_{1},*i*_{2}, ... ,*i*_{m}such that*w*_{i1}*w*_{i2}...*w*_{im}=*x*_{i1}*x*_{i2}...*x*_{im}. An integer index can be repeated many times in a solution. - Modified PCP (MPCP)
- An instance of MPCP consists of two
lists of strings over some alphabet where the two lists have the same
number of strings.
For example, the pair (
*A*,*B*) where*A*= (*w*_{1},*w*_{2}, ... ,*w*_{k}) and*B*= (*x*_{1},*x*_{2}, ... ,*x*_{k}) is an instance of MPCP. - However, a solution to this instance of the MPCP is a sequence
of zero or more integers
*i*_{1},*i*_{2}, ... ,*i*_{m}such that*w*_{1}*w*_{i1}*w*_{i2}...*w*_{im}=*x*_{1}*x*_{i1}*x*_{i2}...*x*_{im}. Note that the first string in each of the lists has to be the first string in the solution. - We can show PCP is undecidable by reducing the universal language
*L*to MPCP and then reducing MPCP to PCP._{u}

- A language
*L*is undecidable if (1)*L*is not recursively enumerable or (2)*L*is recursively enumerable but not recursive. - We have shown the diagonal language
*L*is not recursively enumerable and the universal language_{d}*L*is recursively enumerable but not recursive. We can use the undecidability of these two languages to show a number of problems about Turing machines are undecidable:_{u} - Define
*L*to be {_{e}*M*| L(*M*) = ∅ }. We can show that*L*is not recursively enumerable. See HMU Section 9.3.2 for a proof._{e} - Define
*L*to be {_{ne}*M*| L(*M*) ≠ ∅ }.*L*is the complement of_{ne}*L*. We can show that_{e}*L*is recursively enumerable but not recursive. Again, see HMU Section 9.3.2 for a proof._{ne} - Note that we have just stated that
*L*is not recursive. If_{ne}*L*were recursively enumerable, both it and_{e}*L*would be recursive because_{ne}*L*and_{e}*L*are complements of each other. This is the reason why_{ne}*L*cannot be recursively enumerable._{e} - The Halting Problem
- In Alan Turing’s original formulation of Turing machines acceptance was just by halting not necessarily by halting in a final state.
- We can define
*H*(*M*) for a Turing machine*M*to be the set of input strings*w*such that*M*halts on*w*in either a final or a nonfinal state. - The famous
*halting problem*is the set of pairs {(*M, w*) |*w*is in*H*(*M*)}. - We can show the halting problem is recursively enumerable but not recursive.
- There is a useful result called "Rice's Theorem" that states that any nontrivial property of Turing machines that depends only on the language that the TM accepts must be undecidable. A property of the recursively enumerable languages is just a set of recursively enumerable languages. A property is trivial if it either is the empty language or is the set of all recursively enumerable languages; otherwise, the property is said to be nontrivial. One example of a nontrivial property is whether a language is context free. Thus, by Rice's Theorem determining whether the language accepted by a Turing machine is context free is undecidable.

- We have already shown that it is undecidable whether a context-free grammar is ambiguous. The proof technique we used was to reduce Post’s Correspondence Problem to the ambiguity problem for CFG’s.
- We can also use this proof technique to show a number of important problems about context-free languages are undecidable.
- Let
*G*and*H*be CFG’s, and let*R*be a regular expression. The following problems are undecidable: - Is
*L*(*G*) ∩*L*(*H*) = ∅? - Is
*L*(*G*) =*L*(*H*)? - Is
*L*(*G*) =*L*(*R*)? - Is
*L*(*G*) = Σ* for some alphabet Σ? - Is
*L*(*G*) ⊆*L*(*H*) = ∅? - Is
*L*(*R*) ⊆*L*(*G*) = ∅? - Proofs of these results are in HMU Section 9.5.3.

- Show that if the complement of a language
*L*is undecidable, then*L*itself is undecidable. - Show that the Halting Problem is recursively enumerable but not recursive.
- Show that it is undecidable whether the language accepted by a TM is infinite.
- Show that the complement of the list language
*L*[HMU, p. 413] is context free._{A} - Show that it is undecidable whether the language generated by one context-free grammar is contained within the language generated by another context-free grammar.
- Let
*L*be the set of CFG’s*G*such that L(*G*) contains at least one palindrome. Show that*L*is undecidable. - Give an example of a language
*L*such that both*L*and the complement of*L*are not recursively enumerable.

- HMU: Ch. 9

aho@cs.columbia.edu verma@cs.columbia.edu