a5 - . Give a verbal description of the langauge generated...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 5 CS 321 Due Date: 11/10/10, 2 PM Note: The homeworks should be your own work. You can discuss the homeworks orally with your peers, however. You should not use any web sources for this assignment. Please see the TA and the instructor during the oFce hours to get more help. 1. ±ind context-free grammars for the following languages (with n 0 ,m 0 ,k 0). (a) [5.1 Problem 7e] L = { w ∈ { a,b } * : n a ( w ) 6 = n b ( w ) } (b) [5.1 Problem 7f] L = { w ∈ { a,b } * : n a ( v ) n b ( v ), where v is any prefix of w } (c) [5.1 Problem 8b] L = { a n b m c k : n = m or m 6 = k } . (d) [5.1 Problem 8g] L = { a n b m c k : k 6 = n + m } . 2. [5.1 Problem 19] Show a derivation tree for the string aabbbb with the grammar: S AB | λ , A aB , B Sb
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: . Give a verbal description of the langauge generated by the above grammar. 3. [5.1 Problem 26] ind a linear grammar for the language L = { a n b m : n 6 = m } . 4. [5.2 Problem 3] ind an s-grammar for L = { a n b n +1 : n > = 2 } . 5. [5.2 Problem 7] Construct an unambiguous grammar equivalent to the grammar: S AB | aaB , A a | Aa , B b . 6. [5.2 Problem 13] Show that the following grammar is ambiguous. S aSbS | bSaS | . 7. [5.2 Problem 18] Show that the grammar S aAb | A aAb | is unambiguous. 1...
View Full Document

This note was uploaded on 12/04/2010 for the course CS 321 taught by Professor Staff during the Fall '08 term at Oregon State.

Ask a homework question - tutors are online