{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw6-sol - ECS 120 Introduction to Theory of Computation...

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

View Full Document Right Arrow Icon
ECS 120: Introduction to Theory of Computation Homework 6 Problem 1. Prove that L a = { a i b j c k : j = max { i, k }} is not context free. Suppose for contradiction that L a were context free. Let N be the “ N ” of the pump- ing lemma for context free languages. Consider the string w = a N b N c N . Suppose w = uvxyz , where | vxy | ≤ N and | vy | ≥ 1. If vy contains only a ’s or vy contains only c ’s, then pump up: the string uv 2 xy 2 z 6∈ L a . Suppose vy contains only b ’s. Then we can pump either way to get a string not in L a . Suppose v contains two different letters or y contains two different letters. Then uv 2 xy 2 z is not even of the form a * b * c * , so certainly it is not in L a . Finally, suppose ( v a + and) y b + , or v b + (and y c + ). Then we can pump down and there will be too few b ’s. By | vwy | ≤ N , these are all the possible cases. So in all cases there is some i for which uv i xy i z 6∈ L , a contradiction. Problem 2. Show that the following languages are context-free by designing push-down automata that recognize them. (a) The complement of the language L = { a n b n | n 0 } The idea is to design a “deterministic” PDA (no transitions, and all other transi- tions accounted for) that accepts L and then switch accepting states. The resulting automaton will work like this: In the first state (which is non-accepting), go into an accepting trap sate T if a b is read; if an a is read push a $ onto the stack while going to the next state S a . As usual, T just loops into itself, no matter what letter is read.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern