# CMPSCI 401: Theory of Computation

### David Mix Barrington

### Spring, 2012

# Homework Assignment #1

#### Posted Tuesday 24 January 2011

#### Due on paper in class, Monday 6 February 2010

There are twelve questions for 100 total points.
All but one are
the textbook, *Introduction to the Theory of Computation*
by Michael Sipser (second edition).
The number in parentheses following each problem
is its individual point value.

Students are responsible for understanding and following
the academic honesty
policies indicated on this page.

- The first four problems use the following definitions.
Let Σ be the alphabet {a, b, c}.
Define the following three languages over Σ. X is the set of
strings of odd length whose middle letter is c. Y is the set of
strings
of odd length whose first and last letters are the same. Z is the
set
of strings (of any length) containing at least one a, at least one b, and at least
one c.
- Problem A-1 (10): There are a total of 27 strings of length 3 over
Σ.
Determine how many are in X, in Y, in Z, in X ∪ Y ∪ Z, and in X ∩ Y ∩ Z.
(Brute force counting is probably the easiest way to go here.)
- Problem A-2 (10): Let f be a function from strings over
Σ to strings over Σ, defined by the rules f(λ) =
λ
and for all strings w and letters z, f(wz) = zf(w). Argue
informally that for any string w, f(w) ∈ X if and only if w
∈ X, f(w) ∈ Y if and only if w ∈ Y, and f(w) ∈ Z
if
and only if w ∈ Z.
- Problem A-3 (10): Build a DFA or NFA whose language is Y, and a DFA
whose
language is Z. (You should present your machines as state diagrams.)
- Problem A-4 (10): Give regular expressions for the languages
Y, Z, and Y ∪ Z.
- Exercise 0.6 (5)
- Problem 0.11 (5)
- Exercise 1.12 (10)
- Exercise 1.19 (5) You may use either the book's method or mine.
- Exercise 1.20 (5)
- Exercise 1.21 (10) You may use either the book's method or mine.
- Problem 1.42 (10) Note the subtle difference between the
statements of Problem 1.41 and 1.42. (Hint: Assume that you have
DFA's
for A and B and build an NFA for the product language. Remember the
construction to run two DFA's in parallel, used in the proof of
Theorem 1.25 on pages 45-47.)
- Problem 1.60 (10)

Last modified 24 January 2012