CS 321 HW 4 Due Thursday Oct 22, 5pm, on Canvas. The important problems for Quiz 4 are: 1, 4, 7, 8, 10. 1. Convert the following NFAs from HW3 to DFA: (a) {ab, aba}* (b) bitstrings with 0 as the third last symbol (c) bitstrings that contain 0100 How do these converted DFAs compare to your own DFAs in HW3? 2. For any given epsilon-free NFA M = (Q, \Sigma, \delta, q_0, F), (a) construct a DFA M' such that L(M) = L(M'). (b) prove that L(M) = L(M'). i.e., for all w \in L(M), you want to show w \in L(M'), and for all w \in L(M'), you want to show w \in L(M). Hint: first prove a lemma by induction: for all q \in Q, for all w \in Sigma*, \delta*(q, w) = \delta'*({q}, w). 3. Show that for an NFA w/o epsilons, the two definitions of \delta* are equivalent, i.e., if we use the standard definition (w=xa), you want to show: \delta*(q, ax) = \cup_{p \in \delta(q, a)} \delta*(p, x) 4. Write at least three definitions of epsilon-closure. Also define the epsilon-closure of a set of states. 5. (Redo 2 for epsilons) For any given NFA with epsilons M = (Q, \Sigma, \delta, q_0, F), (a) construct a DFA M' such that L(M) = L(M'). (b) prove that L(M) = L(M'). i.e., for all w \in L(M), you want to show w \in L(M'), and for all w \in L(M'), you want to show w \in L(M). Hint: see 2. 6. (Redo 3 for epsilons) Figure out an alternative definition of \delta* for NFA with epsilons, and prove the equivalence. 7. Devise an algorithm to convert an NFA with epsilons to an epsilon-free NFA. 8. Convert the NFAs from the last two questions in Quiz 3 to DFAs. Quiz 3 solutions are on canvas. 9. Why it is important to add "the smallest set" in Def. 1 of epsilon-closure? Give an example where dropping "the smallest" doesn't make sense. 10. For each of the following NFAs, do (a) compute epsilon-closure for each state, (b) convert it to a DFA, (c) explain the intuitive meaning of the language (d) try to find a smaller but equivalent DFA, if any. \Sigma = {a,b}, Q = {q,r,s,v,t}. start state is q, and acceptings states are r and t. from q, on \epsilon goes to r and s. from r, on b self-loops, and on \epsilon goes to t from s, on b goes to v, and on \epsilon goes to t from v, on a goes to s See the picture at: http://classes.engr.oregonstate.edu/eecs/fall2015/cs321/nfa.pdf and LaTeX source at: http://classes.engr.oregonstate.edu/eecs/fall2015/cs321/nfa.tex Now flip the two links between s and v and redo everything. (i.e., from s on a goes to v, from v on b goes back to s). Now further add an \epsilon link from t to r and redo everything. Debriefing (required!): -------------------------- 1. Approximately how many hours did you spend on this assignment? 2. Would you rate it as easy, moderate, or difficult? 3. Did you work on it mostly alone, or mostly with other people? 4. How deeply do you feel you understand the material it covers (0%–100%)? 5. Any other comments?