This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS381 Final Exam Friday Dec 12, 2003 Fall 2003 Olin 255 9:00-11:30 This is a 2 1 2 hour in class closed book exam. All questions are straightforward and you should have no trouble doing them. Please show all work and write legibly. Thank you. 1. Is it decidable for regular sets 1 R and 2 R whether 1 2 R R ? Justify your answer. Answer : 1 2 1 2 iff R R R R . But 1 2 R R is a regular set and emptiness for regular sets is decidable. 2. Write a context-free grammar for the compliment of | ( )* ww w a b . Answer : | | | | | | | | | | | | | | | S AB BA O A aAa aAb bAa bAb a B aBa aBb bBa bBb b O aaO abO baO bbO a b 3. Let * L a b be a context-free language. In each string interchange the order of a and b in each occurrence of ab. Is the resulting language context free? Give a proof of your answer. Examples aabb abab ababab bababa bababa bbabaa Answer : Define 1 h , 2 h , and R as follows 1 2 1 2 1 2 ( ) ( ) ( ) ( ) ( ) ( ) h a a h a a h b b h b...
View Full Document
- Fall '07