CS5371 Theory of Computation
Homework 3
Due: 2:10 pm, December 4, 2007 (before class)
1. Let k-PDA be a pushdown automaton that has k stacks. Thus a 0-PDA is an NFA and
a 1-PDA is a conventional PDA. We already know that 1-PDAs are more powerful than
0-PDAs (since 1-PDAs recognize a larger class of languages).
(a) (15%) Show that some language can be recognized by a 2-PDA but not a 1-PDA.
Conclude that 2-PDAs are more powerful than 1-PDAs.
(b) (Further studies: No marks) Show that if a language L can be recognized by a 3-
PDA, L can be recognized by some 2-PDA. Conclude that 2-PDAs are as powerful as
3-PDAs.
2. (20%) Show that a language is decidable if and only if some enumerator enumerates the
language in a way that shorter strings are enumerated first, while for equal-length strings,
they are enumerated in lexicographic order.
3. Let S = {hM i | M is a DFA that accepts w whenever it accepts the reverse of w}.
(a) (5%) Give an example of a DFA that is in S.
(b) (20%) Show that S is decidable.
4. (20%) Let P ALDF A = {hM i | M is a DFA that accepts some palindrome}. Show that
P ALDF A is decidable. (Hint: Prob 2.18 and Prob 4.23 are helpful here.)
5. (20%) Suppose that we have a decider D that decides if the language of a CFG is infinite.
That is, D is a decider for the language:
INFINITE CF G = {hGi | G is a CFG and L(G) is infinite}.
By using D or otherwise, show that the following language:
CCF G = {hG, ki | G is a CFG and L(G) contains exactly k strings where k ≥ 0 or k = ∞}
is decidable.
6. (Further studies: No marks) Let C be a language. Prove that C is Turing-recognizable if
and only if a decidable language D exists such that C = {x | ∃y(hx, yi ∈ D)}.