CS150 HW1 Set 10/7 Due 10/17, Thursday, 5pm Total: 60 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 [10 pts] Give DFA's accepting the following languages over the alphabet {0,1}: a) The set of all strings that begin with a 1 and end with a 0. b) The set of all strings that contain four consecutive 1's. Q2 [10 pts] Give DFA's accepting the following languages over the alphabet {0,1}: a) The set of all strings whose 3rd symbol from the right end is a 0. b) The set of strings such that the number of 0's is divisible by 3 and the number of 1's divisible by 2. Q3 [10 pts] P.54 Ex.2.2.7 (the same in the second edition of HMU). For your convenience, the question is also repeated here: Let A be a DFA and q a particular state of A, such that delta(q,a) = q for all input symbols a. Prove by induction on the length of the input that for all input strings w, delta^hat(q,w) = q. Here, delta denotes the transition function of A and delta^hat denotes the extended transition function. Q4 [15 pts + bonus 5 pts] Design an NFA for each of the languages in P.53-54 (or P.54 in the second ed), Ex.2.2.5 b), c), and d). The NFA for the language in part a) is optional and worth 5 bonus points. Note that since a DFA is a special case of NFA, you may feel free to use a DFA instead of an NFA for any of these languages. For your convenience, the languages in Ex.2.2.5 are repeated here: a) The set of all strings such that each block of five consecutive symbols contain at least two 0's. b) The set of all strings whose tenth symbol from the right end is a 1. c) The set of strings that either begin or end (or both) with 01. d) The set of strings such that the number of 0's is divisible by five, and the number of 1's is divisible by 3. Q5 [15 pts] a) Convert the following NFA to a DFA: 0 1 ---------------------- -> a || {a} | {a,b} b || {c} | {c} c || {d} | {d} d || {e} | {e} * e || {} | {} b) Informally describe the language that it accepts.