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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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 ≥ } 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...
View Full Document

This note was uploaded on 04/29/2010 for the course ECS 222 taught by Professor Mr. during the Spring '10 term at UC Davis.

Page1 / 3

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online