CS 321 HW 3 Due Thursday Oct 15, 5pm, on Canvas. Hint: problems 1, 4, 7 are harder than the others. Quiz 3 will have problems similar to 2, 3, 6, 8--10. 1. For any DFA, prove that \delta∗ is associative; that is for any input strings x and y, \delta∗(q, xy) = \delta*(\delta*(q, x), y). Hint: it might be helpful to prove the following lemma first: for all q, for all x \in \Sigma*, for all a \in Sigma: \delta*(q, ax) = \delta*(\delta(q, a), x). Note that this lemma is almost identical to HW2 problem 2, which you can reuse the proof. 2. In the cross-product construction, we also extended \delta* (see slides, the last page). There are two very different definitions for \delta*, now prove they are equivalent. Hint: we will take the first definition of \delta* on the new DFA, and then prove the following theorem by induction: \delta*((p,q), w) = (\delta*_1 (p, w), \delta*_2 (q, w)) 3. L1 = bitstrings that do *not* contain 01. L2 = bitstrings that do *not* contain 00. Construct machines for L1 and L2, but both in 2 states plus the trap state. Now construct new machines that recognizes: (a) L1 \cap L2 (b) L1 \cup L2 (c) L1 - L2 (d) L2 - L1 (\cap is the LaTeX symbol for set intersection, and \cup for union; note L2 - L1 == L2 \ L1 where "\" is "set minus") In each of these constructions, (a) explain the intuitive meaning of each new language. (b) explain why your new DFA recognizes the new language. indicate the trap states in your DFA (may be more than one). (c) try to find a small DFA which does the same job, if possible, and explain the intuition behind the smaller DFA. 4. If \delta is a partial function in each of the two machines, how do you construct the combined DFA? note that the state (trap, trap) is always rejecting so you don't need to include it. Also, for different operations (intersection, union, ...), you can define different partial \delta to produce a smaller DFA (e.g. for intersection you need fewer states than union). 5. Construct a DFA for the language {ab, aba}*, i.e., {\epsilon, ab, aba, abab, abaaba, ababa, abaab, ababab, ...} Explain your solution. 6. Redo the above using NFA. 7. Construct a DFA for bitstrings with 0 as the third last symbol from the end. Explain your solution. 8. Redo the above using NFA. 9. Redo Problem 3 (b) using NFA. Does NFA help in Problem 3 (a), (c), (d) as well? 10. Construct both DFA and NFA for: bitstrings that do contain 0100. BTW does NFA help for "bitstrings that do *not* contain xxx"? 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?