

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about homework 2 for the cs 172: computability and complexity course, taught by s. A. Seshia and a. Kulkarni, in spring 2008. The homework covers topics such as equivalence of dfas and nfas, regular expressions, and regular languages. Students are required to complete various problems and provide clear and concise solutions.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


CS 172: Computability and Complexity, Spring 2008 S. A. Seshia & A. Kulkarni
Assigned: January 31, 2008 Due in 283 Soda box, 5pm: February 7, 2006
Note: Take time to write clear and concise solutions. Confused and long-winded answers may be penalized. Consult the course webpage for course policies on collaboration.
(a) Give an NFA recognizing all binary strings with a 1 in the third position from the end and a 0 in the fourth position from the end. (b) Following the equivalence proof, convert this to a DFA. (c) Give a regular expression for this language. You are not required to use the equivalence proof. (d) Simplify the DFA given in part (b) so that every state is reachable by some possible computation of the machine.
w^1 /^2 : w ∈ L
Prove that if L is regular, then L^1 /^2 is regular.
Hint: If a DFA recognizing L has state space Q, construct an NFA with state space Q × Q where the first coordinate goes forward and the second coordinate goes back- ward.
(a) Prove that every NFA can be converted to an equivalent NFA that has a single accept state. (b) Give an example to support the falsity of the following statement: every DFA can be converted into an equivalent DFA with a single accept state. (c) (no points, optional) Give an NFA with a single accept state that recognizes L = ∅. Also, prove formally that the statement in part (b) is false.
(a) (a ∪ ba ∪ bb)Σ∗ (b) Σ∗aΣ∗bΣ∗aΣ∗
Write down a regular expression that generates L. Justify your answer.
(a) Let A be a regular expression. Prove that A ◦ ε = A. (b) In the C programming language, comments appear between delimiters such as /∗ and ∗/. Let L denote the language of all valid delimited comment strings. A member of L must begin with /∗ and end with ∗/ but have no intervening ∗/. For simplicity, assume that the comments themselves are written only with the symbols 0 and 1 , so the alphabet Σ is { 0 , 1 , ∗, /}. Give a regular expression that generates L.