381prelim2sol_FA05 - CS381 Fall 2005 Second Mid Term Olin...

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

View Full Document Right Arrow Icon
CS381 Second Mid Term Friday, Nov. 4, 2005 Fall 2005 Olin 155 9:05-9:55 am 1. Is the language { } |1 , 1 jj ii La b c d i j =≥ a context-free language? If yes give a Chomsky normal form context-free grammar for it. If not use the pumping lemma to prove that it is not a context-free language. No it is not a context-free language. Assume it is. Let n be the integer of the pumping lemma. Select nnn n z abcd = . Write z=uvwxy with vwx n . Then vx cannot contain both a’s and c’s nor can it contain both b’s and d’s. Thus 22 uv wx y has an unequal number of a’s and c’s or an unequal number of b’s and d’s and is not in L, a contradiction. Therefore L is not a context-free language. 2. What is the specific class of languages defined by grammars in which each production is of one of the following forms: A variable goes to epsilon A ε A variable goes to a terminal A a A variable goes to a string consisting of two terminals A ab A variable goes to a string consisting of a terminal followed by
Background image of page 1

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

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

Page1 / 2

381prelim2sol_FA05 - CS381 Fall 2005 Second Mid Term Olin...

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