Homework 1
CS 310
Spring 2000
Craig A. Rich


Solve the following problems from chapter 3 of Martin, "Introduction to Languages and the Theory of Computation."

1
(Exercise 3.1, Martin) In each case, find a string of minimum length in {0,1}* not in the language denoted by the regular expression.

a) 1*(01)*0*
b) (0*+1*)(0*+1*)(0*+1*)
c) 0*(100*)*1*
d) 1*(0+10)*1*

2
(Exercise 3.2, Martin) Consider the two regular expressions
r1 = 0*+1*, r2 = 01*+10*+1*0+(0*1)*.

a) Find a string corresponding to r1 but not to r2.
b) Find a string corresponding to r2 but not to r1.
c) Find a string corresponding to both r1 and r2.
d) Find a string in {0,1}* corresponding to neither r1 nor r2.

3
(Exercise 3.3, Martin) Let r1 and r2 be arbitrary regular expressions over the alphabet Σ. In each case, find a simpler regular expression that denotes the same language as the given one.

a) (r1+r2+r1r2+r2r1)*
b) (r1(r1+r2)*)+
c) r1(r1*r1+r1*)+r1*
d) (r1+Λ)*
e) (r1+r2)*r1r2(r1+r2)*+r2*r1*

4
(Exercise 3.5, Martin) Prove the equivalence formula (111*)* = (11+111)*.

5
(Exercise 3.8, Martin) Find a regular expression denoting each of the following subsets of {0,1}*.

a) The language of all strings containing exactly two 0's.
b) The language of all strings containing at least two 0's.
c) The language of all strings that do not end with 01.
d) The language of all strings that begin or end with 00 or 11.
e) The language of all strings containing no more than one occurrence of the string 00. (The string 000 should be viewed as containing two occurrences of 00.)
f) The language of all strings in which the number of 0's is even.

6
(Exercise 3.9, Martin) Describe as simply as possible the language denoted by each of the following regular expressions.

a) 0*1(0*10*1)*0*
b) ((0+1)3)*(Λ+0+1)
c) (1+01)*(0+01)*
d) (0+1)*(0+1+0++1+0+1+)(0+1)* (Give an answer of the form: All strings contain both the substring ??? and the substring ???.)