CS 390 Final Exam



August, 2003



1. Convert the following NFA-$\Lambda$ to NFA and draw its transition table.   [15]







2 (a) Is the language { $0^{m}1^{n} \mid m, n$ are natural numbers } regular ? If the answer is yes, give a regular expression for that else prove that it is not regular.   [8]
(b) Prove that the language $L$ = { $0^{m}1^{n}0^{n}$ : $m, n$ are natural numbers.} is non-regular.   [9]
(c) Prove that the language { $www^{r} \mid$ $w \in \{ 0, 1\}^{*}$ } is non-regular, where $w^{r}$ is the reversal of $w$.   [8]

3. For the grammar given below answer the following questions: [4 points each]

(a) What kind of grammar is it ? Regular, context-free, context-sensitive or phrase structure ?
(b) How many a's does its string have ? None, one, two, odd, even, arbitrary, etc ?
(c) How many b's does its string have ? None, one, two, odd, even, arbitrary, etc ?
(d) List all strings of length three of this language.
(e) Describe the strings generated by the grammar.

$S \rightarrow AA $
$A \rightarrow AAA $
$A \rightarrow bA \mid Ab \mid a $
where $a$ and $b$ are terminals, $S$ and $A$ are nonterminals and $S$ is the start symbol.


4 (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^{n}a^{n}$ : $n$ is a positive integer}. [10]

(b) Repeat (a) for a Turing machine that decides the language $L$. [10]


5 (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. [10]
(b) Explain in what sense unsolvable problems such as the "Halting Problem" are unsolvable. [10]