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

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

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 office hours to get more help. 1. Find 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
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern