CS150 HW2 Set 10/16 Due 10/28, Monday, 5pm Total: 75 pts * If you are using an international edition of the textbook, * please double check page and exercise numbers to make sure * you are solving the correct questions. Q1 [15 pts] P.79 (P. 80 in the 2nd ed) Ex.2.5.2. Repeat Exercise 2.5.1 for the following e-NFA: || eps | a | b | c --------------------------------- -> p || {q,r} | {} | {q} | {r} q || {} | {p} | {r} | {p,q} *r || {} | {} | {} | {} a) Compute the e-closure of each state. b) Give all the strings of length three or less accepted by the automaton. c) Convert the automaton to a DFA. Q2 [10 pts] Write regular expressions for the following languages: a) The set of strings of 0's and 1's whose 10th symbol from the right is a 1. b) The set of strings of 0's and 1's with at most one pair of consecutive 1's. Q3 [20 pts] Convert the following DFA to a regular expression by following the state elimination technique. Show all the important intermediate steps. || 0 | 1 ------------------- ->* a || b | c b || a | d c || d | a * d || c | b Q4 [10 pts] P.108 (P. 107 in the 2nd ed) Ex.3.2.6: c), d). Let A = (...) be an e-NFA such that ... You may describe the languages using a combination of plain English and mathematics notations (such as set notations). Please also consult the answers for parts a) and b) available on the textbook homepage: http://www-db.stanford.edu/~ullman/ialc.html Q5 [20 pts] PP.121-122 (P. 121 in the 2nd ed) Ex.3.4.1: e), g). Verify the following identities involving regular expressions. e) (R+S)T = RT +ST. g) (e+R)* = R*. You may use either the test technique in Section 3.4.7 (also see the sample solution for part a) on the textbook homepage), or the general proof technique used in the proof of Theorem 3.11.