hw07 - of the textbook) Use the CL pumping lemma to show...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

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

Unformatted text preview: of the textbook) Use the CL 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 CL 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 0s and 1s. The PDA may accept this language either by Fnal state or by empty stack, whichever is more convenient. 2...
View Full Document

Page1 / 2

hw07 - of the textbook) Use the CL pumping lemma to show...

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