CS
xxx_sol3

# xxx_sol3 - CS3500 HW3 Solutions 1(10 points each a Yes We...

• Notes
• 3

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

CS3500 HW3 Solutions 1 (10 points each) a. Yes. We know L 1 = { w : w has an occurrence of 001 or | w | is odd } . Let A = { w : w has an occurrence of 010 } and B = { w : | w | is odd } , then L 1 = A B . Clearly, A and B are both regular. So L 1 is regular since the class of regular languages is closed under union and complement. b. Yes. Assume the alphabet Σ is { 0 , 1 } , then the regular language A = ΣΣ(ΣΣΣ) * = { w : | w | = 3 n + 2 for some n 0 } and B = L (0 * 1 * ). Clearly, L 2 = A B and thus L 2 is also regular. c. No. Assume L 3 is regular. Let p be the pumping length and s be the string 0 p 1 2 p 0 p . Because s is a member of L and s has length more than p , the pumping lemma guarantees that s can be split into three pieces, s = xyz satisfying the three conditions of the pumping lemma. Because of condition 3 ( | xy | ≤ p ), y can only consist of 0s. Then the string xy 2 z will not be in L . This is a contradiction. d. No. Assume L 4 is regular. Then its complement L 4 is also regular. Furthermore, the language L 4 ∩{ 0 * 1 * 0 * } is also regular since the class of regular languages is closed under intersection. We know that L 4 ∩ { 0 * 1 * 0 * } = L 3 is not a regular language from part c ) and this is a contradiction. Note: The complement of L 4 is NOT L 3 . 2 (10 points each) a. No. Assume L 5 is a CFL. Let p be the pumping length and s be the string a p b p c p +1 . Because s is a member of L 5 and s has length more than p , the pumping lemma guarantees that s can be split into s = uvxyz

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '09
• Ib
• Formal language, Formal languages, Regular expression, Regular language, Pumping lemma for regular languages, carryover tape

{[ 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