CS547T MIDTERM
Professor Loui Spring 2007


A. Write them out.  (2 points each)

1. {a, b, c} times.gif {a, b}, the Cartesian Product.

2. {a, b, c}{a, b} the Set Concatenation.

3. { x in.gif {a, b, c}^^*^^^ | length(x) = 2 }

4. { x in.gif {a, b, c}^^*^^^ | length(x) = 0 }

5. { x in.gif {a, b, c}^^*^^^ | length(x) is infinite }

6. { x in.gif {a, b, c}^^*^^^ | length(x) is -1 }

7. cardinality of { {x}^^*^^^ | x in.gif {a, b, c} }

8. [ 0^^*^^^ ]  -  [ 0^^+^^^ ] 
	(the denotation of 0^^*^^^ set-difference the denotation of 0^^+^^^, for a symbol 0)

9. [ 0^^+^^^ ]  -  [ 0^^*^^^ ] 
	(the denotation of 0^^+^^^ set-difference the denotation of 0^^*^^^, for a symbol 0)

10. [ ((0^^+^^^)^^*^^^)^^*^^^ ]  -  [ ((0^^+^^^)^^+^^^)^^+^^^ ]


B.  True or False.  (2 points each)

1.  There is a finite nonregular language.

2.  The distinguishability relation w.r.t any given language L is
an equivalence relation.

3.  There is a language, L, accepted by a pushdown automaton and there is
no FSM that accepts L.

4.  There is a language, L, accepted by a nondeterministic finite state
machine and there is no DFA that accepts L.

5.  There is a DFA with an empty set of states.

6.  There is a PDA with exactly one state that accepts an infinite language
based on emptying the stack.

7.  There is a PDA with exactly one state that accepts an infinite language
based on reaching a final state.

8.  There is a finite language L s.t. one of the equivalence classes of
I_L has exactly two members.

9.  There is an NFA with exactly one state that has two distinct equivalence
classes under I_L.

10.  There exists a nonregular language, L, s.t. its intersection 
with a regular language is nonregular.

C.  Regular or Non-Regular?  (2 points each)

1.  { 0^n | n is prime }

2.  { 0^n | n is congruent to 0 mod 3 }

3.  { 0^n 1^n | n in.gif naturals.gif, n > 100, n < 1000 }

4.  { 0^n 1^n 1^n 0^n | n in.gif naturals.gif, n < 100 }

5.  { x in.gif {0,1}^^*^^^ | the number of 01 boundaries in x 
	equals the number of 10 boundaries in x }  
	(101110 has two 10 boundaries and one 01 boundary)

6.  { 0^n 1^m | n < m }

7.  { x in.gif {0,1}^^*^^^ | for any prefix y of x, absval(n_0(y) - n_1(y)) < 3 } 
	where n_0(y) is the number of 0's in y, and n_1(y) is the number of 1's in y.

8.  { 0^n 1^m | n in.gif {3,6,9}, m is even }

9.  L = mu { (), xy, (x) | x,y in.gif L }

10.  L = mu { a, xa | x in.gif L }


D.  Proofs.  Style counts.  (8 points each)

1.  Use the pumping lemma to prove that { xcx^r | x in.gif {a,b,c,d}^^*^^^ } is nonregular.

2.  Prove that there are more languages over a given  Sigma.gif  than there are
pushdown automata that use  Sigma.gif  as an input alphabet and have a finite
stack alphabet.  

You may assume any result of Cantor.

3.  Prove that any FSM M can be reduced to an NPDA, M', s.t. L(M) = L_f(M').

4.  Prove that for any NPDA M, there exists an NPDA M', s.t. L_f(M) = L_e(M').

5.  Prove the second half of Kleene's theorem:  For every DFA, M, there exists
a regular expression denoting L(M).