{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cs381-fall03-final-solutions

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

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

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 1 2 R R ? Justify your answer. Answer : 1 2 1 2 iff R R R R = I Φ . But 1 2 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 : | | | | | | | | | | | | | | | 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 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 a b + ) Examples aabb abab ababab bababa bababa bbabaa Answer : Define , , and R as follows 1 h 2 h 1 2 1 2 1 2 ( ) ( ) ( ) ( ) ( ) ( ) h a a h a a h b b h b b h c ab h c ba = = = = = = ( ) ( ) ( ) * * R a a b c a b c a b c = + + + + + + * 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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online