CS 390 Final Exam



August, 2002



1. Prove that the language $L$ = { $0^{n}1^{m}0^{n}$ : $m, n$ are natural numbers.} is non-regular.

2. For the grammar given below answer the following questions:

(a) What kind of grammar is it ? Regular, context-free, context-sensitive or phrase structure ?
(b) Describe the strings generated by the grammar.

$S \rightarrow 0S0 $
$S \rightarrow 1Y $
$Y \rightarrow 1Y $
$Y \rightarrow 1 $
where $0$ and $1$ are terminals, $S$ and $Y$ are nonterminals and $S$ is the start symbol.

3 (a) Using the basic Turing machines $T_{a}, T_{b}, T_{R}, T_{L},
T_{\Delta}, T_{L_{\Delta}}$ and $T_{R_{\Delta}}$, construct a Turing machine that accepts (but not decides) the language $L$ = { $a^{n}b^{m}a^{n}$ : $m, n$ are natural numbers.}.
(b) Repeat (a) for a Turing machine that decides the language $L$.

4 (a) Explain the relationship between the solvability of a decision problem (i.e. yes-no question) and the decidability of the language corresponding to the decision problem.
(b) Explain in what sense unsolvable problems such as the "Halting Problem" are unsolvable.

5. Following the Kleene's theorem, construct an $NFA-\Lambda$ that accepts the language represented by the regular expression $a^{*}b + (a +b)^{2}$. DO NOT SIMPLIFY.

6 (a) Find a string of minimum length in $\{0, 1\}^{*}$ not in the language corresponding to the regular expression $0^{*}(100^{*})^{*}1^{*}$.
(b) Find a string in $\{0, 1\}^{*}$ corresponding to neither $r_{1}$ nor $r_{2}$, where $r_{1} = 0^{*} + 1^{*}$ and $r_{2} = 01^{*} + 10^{*} + 1^{*}0 + (0^{*}1)^{*}$.
(c) Simplify the regular expression $(0(0 + 1)^{*})^{+}$