CS 390 Solutions to Test


July 20, 2002



1.
(a) False. \Lambda may not be in L.
(b) True.
(c) True.
(d) False. For example the string 101 is not represented by either.
(e) True

2 (a)

State a b
1 \emptyset {1, 2, 3, 4}
2 \emptyset {2, 3}
3 \emptyset \emptyset
4 {3} {1, 2, 3, 4}

(b) {1, 2, 3, 4}
(c) {1, 2, 3, 4}

3. We assume that q0 is the initial state and q3 is the accepting state. Also we omit q and use the subscripts to denote the states of DFA.

State a b
{0} {3} {1, 2}
{1, 2} {2, 3} {3}
{3} \emptyset \emptyset
{2, 3} {2} {3}
{2} {2} {3}
\emptyset \emptyset \emptyset



4. (a) (0 + 1)*0(0 + 1)*0(0 + 1)* or 1*01*0(0+1)*. Others are also possible.
(b) (1+ 01)*(0 + \Lambda). Others are also possible.

You can check the equivalence of regular expressions using the tool given in "Equivalence Check for Regular Expressions".

5. Here we are going to follow the recursive definitions of \Sigma* given in "\delta* and its properties", the length of string given in Example 8 of "Recursive Definition" and the reversal given in "General Induction", all on the Web.

Basis Step: x = \Lambda. Since \Lambda = \Lambdar, | \Lambda | = | \Lambdar |. Hence | x | = | xr |.
Inductive Step: Assume that | x | = | xr | for an arbitrary string x. --- Induction Hypothesis
We are going to prove that | xa | = | (xa)r | for an arbitrary symbol a of the alphabet.
By the definition of the length of string | xa | = | x | + 1.
Also by the definition of the reversal, (xa)r = axr.
Hence | (xa)r | = | axr |.
By the definition of length, | axr | = | a | + | xr | = 1 + | xr |.
Since | xr | = | x | by the induction hypothesis, 1 + | xr | = 1 + | x |.
Hence | axr | = 1 + | x | = | xa |.
End of Proof.