hw5-sol - ECS 120: Intoduction to the 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: Intoduction to the Theory of Computation Homework 5 Due Nov 5, at the beginning of the lecture or by 1pm in Kemper 2131 Problem 1. Find a decision procedure which determines if a given CFG (with alphabet { a,b } ) accepts at least one string which containts exactly 4 b ’s (you can assume that you have procedures that can convert PDAs into CFGs and CFGs into PDAs). This problem was dropped from HW5. A solution will be given in the HW6 sols. Problem 2. (a) Prove that context free languages are closed under the operation * (Kleene closure). If G = ( V, Σ ,R,S ) is a context free grammar then the grammar G = ( V, Σ ,R ,S ) where R = R ∪ { S → SS } ∪ { S → } derives the language ( L ( G )) * . That this is true is almost obvious by the definition of * since the rule S → SS generates any number of repetitions of strings from L ( G ). The empty string is accounted for with the second added rule. (b) Assume that you know that L = { a n b n c n | n ≥ } is not context free. Prove that context free languages are not closed under intersection. The languages L 1 = { a i b i c j | i,j ≥ } and L 2 = { a j b i c i | i,j ≥ } are both context free because we can generate them, respectively, with the following grammars: G 1 : S → BC B → aBb | C → cC | ....
View Full Document

This note was uploaded on 05/06/2008 for the course ECS 120 taught by Professor Filkov during the Fall '07 term at UC Davis.

Page1 / 4

hw5-sol - ECS 120: Intoduction to the 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