CS 390 Final Exam



December 2004



1. Convert the following NFA-$\Lambda$ to NFA. [16]





2. Prove by general/structural induction that if $A \subseteq B$, then $A^{*} \subseteq B^{*}$ for languages $A$ and $B$. [16]

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

(a) What kind of grammar is it ? Regular, context-free, context-sensitive or phrase structure ? [4]

(b) Which ones are in the language, $a$, $ab$, $aaa$, $abaa$ and $a^{n}b^{n}$ ? [4]

(c) Describe in simple English the strings generated by the grammar. [7]

$S \rightarrow aT \mid bT \mid \Lambda $
$T \rightarrow aS \mid bS $
where $a$ and $b$ are terminals, $S$ and $T$ are nonterminals and $S$ is the start symbol.

4. Prove that the language { $ww \mid$ $w \in \{ a, b\}^{*}$ } is non-regular.

5. If the language of the 'yes' instances of a decision problem is accepted by a Turing machine, but not decided, can you say that the problem has been solved ? Give your reasons. [15]

6. Design the following Turing machines:

(a) A Turing machine that decides the language {$aba$} WITHOUT using the basic Turing machines. [8]
(b) A Turing machine that leaves the first half of a given string on the tape. You may assume that the strings are of even length. Also you may use basic Turing machines such as $T_{a}$, $T_{R_{\Delta}}$ etc. [9]
(c) Show how the tape contents and the head position change when the string abbb is given to your Turing machine of 6(b). You can use configurations without states. [5]