# hw07 - of the textbook Use the C±L pumping lemma to show...

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

CS 154 Intro. to Automata and Complexity Theory Handout 29 Autumn 2006 David Dill November 28, 2006 Problem Set 7 Due: December 5, 2006 Homework: (Total 100 points) Do the following exercises. Problem 1. [15 points] Consider the context-free grammar G = ( V, T, P, S ) with V = { S, A, B, C, D } , T = { 0 , 1 , 2 } , and the set of productions P : S AB | CD A 0 A 1 | B 2 B | C 0 C | D 1 D 2 | (a). Give a succinct description of the language: L A = { w T * | A * w } . (b). Give a succinct description of the language of G . (c). Show that the grammar G is ambiguous. Problem 2. [30 points] Consider the following language over the alphabet Σ = { 0 , 1 } . L = { 0 i 1 j | i j 2 i and i 0 } This is the set of strings where all the 0’s come before all the 1’s, and the number of 1’s is at least the number of 0’s but no more than twice the number of 0’s. (a). Provide a context-free grammar for L . (b). Design a PDA that accepts L by final state. Problem 3. [20 points] (Exercise 7.2.1(b) on page 280 of the second edition

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of the textbook) Use the C±L pumping lemma to show that the following language is not context-free. { a n b n c i | i ≤ n } Problem 4. [20 points] (Exercise 7.2.1(c) on page 280 of the second edition of the textbook) Use the C±L pumping lemma to show that the following language is not context-free. { p | p is a prime } Hint : Adapt the same ideas used in Example 4.3, which showed this language not to be regular. Problem 5. [15 points] (Exercise 6.2.1(c) on page 236 of the second edition of the textbook) Design a PDA to accept the set of all strings over the alphabet Σ = { , 1 } with an equal number of 0’s and 1’s. The PDA may accept this language either by Fnal state or by empty stack, whichever is more convenient. 2...
View Full 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