{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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
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 0 } 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 0 } and L 2 = { a j b i c i | i, j 0 } are both context free because we can generate them, respectively, with the following grammars: G 1 : S BC B aBb | C cC | .
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}