Summer 2000 CS 390 Test I



July 12, 2000



1. Which of the following statements are true and which are false ? [30]
(a) $(L^{+})^{*} = L^{+}$.
(b) $(01)^{*}0 = 0(10)^{*}$
(c) $(0^{*} + 1)^{*} = (0 + 1^{*})^{*}$
(d) 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 f(T) \subseteq f(S \cup T)$.
(e) Suppose that $A$ and $B$ are sets and that $f: A \rightarrow B$ is a function. Also suppose that $g: B \rightarrow A$ is a function such that $f(g(y)) = y$ for every $y$ in $B$. Then $g$ is $onto$.

2. Find a regular expression for each of the following languages over alphabet {$a, b$}:

(a) All strings with at least two $a$'s. [15]
(b) All strings which do not contain the substring $ab$. [10]

3. Prove by structural induction on string $y$ that $ \mid xy \mid = \mid x \mid + \mid y \mid$ for an arbitrary fixed string $x$.
You may use the following definitions.
$\Sigma^{*}$ is defined recursively as
Basis Clause: $\Lambda \in \Sigma^{*}$
Inductive Clause: If $w \in \Sigma^{*}$. then $wa \in \Sigma^{*}$ for all $a \in \Sigma$.
Extremal Clause: As usual.

Also for any string $y$, $\mid y \mid$ is defined as
Basis clause: $\mid \Lambda \mid = 0$
Inductive Clause: If $y \in \Sigma^{*}$ and $a \in \Sigma$, then $\mid ya \mid = \mid y \mid + 1$. [23]

4 (a) Recursively define the set of strings of the form $1^{*}0^{*}$. [10]
(b) Give a string of length 3 that is in the set of (a). [6]
(c) Give one of the shortest strings that is not in the set of (a). [6]