# hw6 - that the class of languages recognized by NFAs is not...

This preview shows page 1. Sign up to view the full content.

CSC236H: Introduction to the Theory of Computation Bonus Homework Due on Tuesday April 6, 2010 (in review session, see announcements) Note that this assignment is for extra credit. If you do not want the extra credit, you do not have to hand in this assignment. As mentioned in class, the grading rules are more strict for this assignment. There is no partial credit for any problem; you either get it right and get the full mark, or you get zero. For problems that have several parts, this rule applies to each part, and not the whole problem. 1. If L 1 and L 2 are context-free language, then prove that (a) L 1 L 2 is a context-free language. (b) L 1 L 2 is a context-free language. (c) L * 1 is a context-free language. Hint: There are very short arguments for each of the three parts of this problem. 2. Show by giving an example that, if M is an NFA that recognizes language C , swapping the accept and non- accept state in M does not necessarily yield a new NFA that recognizes the complement of C . Does this mean
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: that the class of languages recognized by NFAs is not closed under complement? 3. Using the Pumping Lemma, prove that following languages are not regular: (a) L = { n 1 m | m,n ≥ 0 and m leaves a remainder of 3 when divided by n . } (b) L 1 = { n 1 m | n,m ≥ 0 and n 6 = m } . (c) L 2 = { w | w ∈ { , 1 } * and w is not a palindrome } . 4. Let CFG G be: S → aSb | Y b | Y a Y → bY | aY | ± Prove that L ( G ) = { a,b } + . 5. For a language L , let Init ( L ) = { x | xy ∈ L for some y ∈ Σ * } . Let r , s , r I and s I be regular expressions for the languages R , S , Init ( R ), and Init ( S ) respectively. Using only these regular expressions and the operations +, concatenation, and * , give expressions for the following languages and brieﬂy justify your answers (Be careful! Contemplate your answers.): (a) (3 points) Init ( R ∪ S ). (b) (3 points) Init ( RS ) . (c) (3 points) Init ( R * ). 1...
View Full Document

## This note was uploaded on 04/11/2010 for the course CSC CSC236 taught by Professor Farzanazadeh during the Spring '10 term at University of Toronto.

Ask a homework question - tutors are online