# 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 Fnal 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

## This note was uploaded on 03/08/2011 for the course CS 154 taught by Professor Motwani,r during the Winter '08 term at Stanford.

### Page1 / 2

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

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

View Full Document
Ask a homework question - tutors are online