# Homework Assignment #2

#### Due on paper in class, Friday 17 February 2012

There are fourteen questions for 100 total points plus 10 extra credit. Most 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.

Corrections in green added 15 September.

• The first two problems use the following definitions, repeated from HW#1. 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 B-1 (10): Prove that X is not a regular langauge. In any of these non-regular language problems, you may use either the Pumping Lemma or my method.

• Problem B-2 (10): Find a regular expression for the language Y ∩ Z.

• Problem B-3 (10XC): A language L has inverses if for every string x, there is another string y such that xy is L-equivalent to ε. A DFA is one-to-one if for every letter a ∈Σ and every pair of states p and q with p ≠ q, δ(p, a) ≠ δ(q, a). Prove that a regular language has inverses if and only if it is the language of some one-to-one DFA. (Correction: One of the two directions of this equivalence is true and the other false. For full credit, you should prove the true one and give a counterexample for the false one.)

• Problem 1.14 part (b) only (5)

• Problem 1.40 part (b) only (10)

• Problem 1.46 part (d) only (5). Note that the symbol before the last brace is a +, not a *. If X is any language, the language X+ is defined to be XX*.

• Problem 1.53 (5)

• Problem 1.63 part (a) only (10)

• Exercise 2.2 (10)

• Exercise 2.12 (5)

• Exercise 2.15 (5) (Find a grammar G such that the constructed grammar G' does not generate the language L(G)*.)

• Problem 2.24 (10)

• Problem 2.26 (5)

• Problem 2.32 (10) This problem requires the use of the CFL Pumping Lemma, Theorem 2.34, which we are not covering in class until the due date. But you should be able to do the problem by adapting Example 2.36 in Sipser.