cs381-fall03-final-solutions - CS381 Fall 2003 Final Exam...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS381 Final Exam Friday, Dec. 12, 2003 Fall 2003 Phillips 101 9:00-11:30 am 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 12 R R ? Justify your answer. Answer : 12 12 iff RR RR ⊆= I Φ . But R R I 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 : || |||| | SA B B A O A aAa aAb bAa bAb a B aBa aBb bBa bBb b O aaO abO baO bbO a b 3. Let 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. ( * L ab + ) Examples aabb abab ababab bababa bababa bbabaa Answer : Define , , and R as follows 1 h 2 h () ha a a hb b b h c ab h c ba == ( ) ** Ra abc =− ++ * b ) R R Then the desired set is . The class of cfl’s is closed under homomorphisms. inverse homomorphisms, and intersection with a regular set.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/19/2008 for the course COM S 381 taught by Professor Hopcroft during the Fall '05 term at Cornell University (Engineering School).

Page1 / 2

cs381-fall03-final-solutions - CS381 Fall 2003 Final Exam...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online