{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Home5ClosureAndPumping

# Home5ClosureAndPumping - CS 341 Automata Theory Elaine Rich...

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

CS 341 Automata Theory Elaine Rich Homework 5 Due Thursday, Oct. 5 at 11:00 1) Using the definitions of maxstring and mix presented in class, describe each of the following languages: a) maxstring (A n B n ) b) maxstring ( a i b j c k , 1 k j i ) c) mix (( aba )*) d) mix ( a * b *) 2) Prove that the regular languages are closed under maxstring . 3) Prove that the regular languages are not closed under mix . 4) For each of the following languages, state whether or not the language is regular and prove your answer: a) L = { xyzy R x : x, y, z { a , b }*}. b) L = { a i b j : 0 i < j < 2000}. c) L = { w { a , b }* : w contains at least one a and at most one b }. d) L = { w {0, 1}* : # 0 ( w ) # 1 ( w )}. e) L = { w { a , b }* : 5 x { a , b } + ( w = x x R x )}. f) L = { a n b m : n l m } g) L = { w { a , b }* : w contains exactly two more b 's than a 's}. 5) Prove or disprove the following statement: If L 1 and L 2 are not regular languages, then L 1 L 2 is not regular. 6) Let Σ = { a , b }. Let α be a regular expression. Is there a decision procedure that determines whether the language generated by α contains all the even length strings in Σ *. Prove your answer.

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

View Full Document
CS 341 Automata Theory Elaine Rich Homework 5 Answers 1) Using the definitions of maxstring and mix presented in class, describe each of the following languages: a) maxstring (A n B n ) = { a n b n : n >0}. (Note: ε max (A n B n ) because each element of A n B n can be concatenated to ε to generate a string in A n B n . But, given any other string in A n B n (e.g., aabb ), there is nothing except ε that can be added to make a string in A n B n .) b) maxstring ( a i b j c k , 1 k j i ) = ( a i b j c j , 1 j i ) c) mix (( aba )*) = ( abaaba )* d) mix ( a * b *): This one is tricky. To come up with the answer, consider the following elements of a * b * and ask what elements they generate in mix ( a * b *): aaa , aab , aaaa , bbbb , aaabbb , aaaabb , aabbbb mix ( a * b *) = ( aa )* ( bb )* { a i b j , i j and i + j is even} { w : | w | = n , n is even, w = a i b j a k , i = n /2} 2) Prove that the regular languages are closed under maxstring . The proof is by construction. If L is regular, then it is accepted by some DFSA M = ( K , Σ , , s , A ). We construct a new DFSM M* = ( K* , Σ * , * , s* , A* ), such that L ( M* ) = maxstring ( L ). The idea is that M * will operate exactly as M would have except that A * will include only states that are accepting states in M
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern