CS 390 Test
July 20, 2002



1. Which of the following statements are true and which are false ?



(a) $(L^{*})^{+} = L^{+}$.
(b) $(0^{*} 1^{*})^{*} = (0^{*} + 1)^{*}$.
(c) $(L_{1}L_{2} \cup L_{3})^{*}$ is regular if $L_{1}$, $L_{2}$, and $L_{3}$ ar e regular.
(d) The string $101$ is represented neither by $(0^{*} + 1^{*})$ nor by $(01^{*} + 10^{*} + 1^{*}0 + (0^{*}1)^{*})$ .
(e) Suppose that A and B are sets, that S and T are subsets of A and that $f$ is a function from A to B. Then $f(S \cup T) \subseteq ( f(S) \cup f(T) )$.



2 (a) Find an $NFA$ that recognizes the same language as the following $NFA-\Lambda$:



State $q$ $a$ $b$ $\Lambda$
$1$ $\emptyset$ {$4$} {$2$}
$2$ $\emptyset$ {$2$} {$3$}
$3$ $\emptyset$ $\emptyset$ $\emptyset$
$4$ {$3$} $\emptyset$ {$1$}



The initial state is $1$ and the accepting state is $3$.
(b) Find $\Lambda(\{4\})$.
(c) Find $\delta^{*}(1,bb)$.



3. Find a DFA that accepts the same language as the following NFA:



$q$ $\sigma$ $\delta(q, \sigma)$ $q$ $\sigma$ $\delta(q, \sigma)$
$q_{0}$ $a$ {$q_{3}$} $q_{2}$ $a$ {$q_{2}$}
$q_{0}$ $b$ {$q_{1}, q_{2}$} $q_{2}$ $b$ {$q_{3}$}
$q_{1}$ $a$ {$q_{3}$} $q_{3}$ $a$ $\emptyset$
$q_{1}$ $b$ $\emptyset$ $q_{3}$ $b$ $\emptyset$



4. Find a regular expression for each of the following languages over the alphabet {0, 1}:



(a) The language of all strings containing at least two 0's.
(b) The language of all strings not containing the string 00 as their substring.



5. Prove that $\mid x \mid$ = $ \mid x^{r} \mid $ for all strings $x$ over the alphabet {a, b} by structural (general) induction, where $ x^{r} $ is the reversal of string $x$ (i.e. $x$ spelled backward) and $\mid x \mid$ denotes the length of string $x$.





S. Toida
2002-07-26