COMS W3261 CS Theory
Lecture 18: Undecidable Problems
1. PCP and Modified PCP are Undecidable
- 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 =
(w1, w2, ... , wk) and
B =
(x1, x2, ... , xk)
is an instance of PCP.
- A solution to this instance of PCP, if one exists, is a sequence of one or more integers
i1, i2, ... , im
such that
wi1
wi2 ...
wim
= xi1
xi2 ...
xim.
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 =
(w1, w2, ... , wk) and
B =
(x1, x2, ... , xk)
is an instance of MPCP.
- However, a solution to this instance of the MPCP is a sequence
of zero or more integers
i1, i2, ... , im
such that
w1wi1
wi2 ... wim
= x1xi1
xi2 ...
xim.
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
Lu to MPCP and then reducing MPCP to PCP.
2. Undecidable Problems about Turing Machines
- 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 Ld is not
recursively enumerable and the universal language Lu
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:
- Define Le to be { M | L(M) = ∅ }.
We can show that Le is not recursively enumerable.
See HMU Section 9.3.2 for a proof.
- Define Lne to be
{ M | L(M ) ≠ ∅ }.
Lne is the complement of Le.
We can show that Lne is recursively enumerable but not
recursive.
Again, see HMU Section 9.3.2 for a proof.
- Note that we have just stated that Lne is not recursive.
If Le were
recursively enumerable, both it and Lne would be recursive
because Le and Lne are complements of each other.
This is the reason why Le cannot be recursively enumerable.
- 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.
3. Undecidable Problems about Context-free Languages
- 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.
4. Practice Problems
- 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 LA [HMU, p. 413]
is context free.
- 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.
5. Reading Assignment
aho@cs.columbia.edu
verma@cs.columbia.edu