The following questions are taken from the final exams in previous years. 1- Let L be the set of strings over {0,1} that contain both 01 and 10 as substrings. (a) Daw the diagram of a DFSA that accepts L (b) Give a regular expression that denotes L. Answer: for part (a) one way is to have q0 -0-> q1 -1-> q2 -0-> q3 and q0 -1-> q4 -0-> q5 -1-> q3. Also, in q1 and q5 we remain with 0 and in q2 and q4 we remain with 1. In q3 we remain with both 0 and 1. q3 is the accepting state. for part (b) one solution (which doesn't seem to be the simples one) is (0+1)^*01(0+1)^*0(0+1)^* + (0+1)^*10(0+1)^*1(0+1)^* 2- Give a 4 state DFSA for the language described by the following regular expression: 00^* + 00^*(11)^* Answer: q0 -0-> q1 -1-> q2 -1-> q3, and q3 -1-> q2 and q1 -0-> q1 the accepting states are q1 and q3. 3- Give a regular expression for the following language: { s in {a,b,c}^* : every a in s is eventually followed by b or c } Answer: one way is (b+c)^*(e + a(a+b+c)^*(b+c)) This question is from the textbook: - Consider the language L over {0,1} consisting of the strings that have an even number of 0's. Does the regular expression 1^*((01^*0)1^*)^* denote this set? how about each of the following expressions: (1+(01^*0))^* , (1^*(01^*0))^*, and (1^*(01^*0)^*)^* Justify your answer. Answer: yes, yes, no (doesn't have 001), yes.