Comp Theory

| October 23, 2015

1. Consider the grammar G: S → a S b S | b S a S | ε Describe in English the language generated by G. Prove that G generates precisely this language. Is the language generated by G regular? Prove your answer. Show that G is ambiguous. 2. Put the grammar G in question (1) into Chomsky Normal Form. Use the Cocke-Younger-Kasami algorithm to parse the sentence abab according to your CNF grammar. Display the CYK table constructed by the CYK algorithm and show how all parse trees for this sentence can be reconstructed from the CYK table. 3. From the grammar G in question (1), construct a pushdown automaton that accepts L(G) by empty stack. Show all sequences of moves that your PDA can make to accept the input string abab. 4. From your PDA in question (3), construct an equivalent context-free grammar. Show all the parse trees for the input string abab according to your grammar. 5. If L is a language, let max(L) = { w | w is in L but for no nonempty x is wx in L }; that is, if w is in L, then there is no continuation of w that is in L. If L’ is the context-free language { apbqcr | p ≥ r or q ≥ r }, what is max(L’)? Use the pumping lemma for CFLs to show that max(L’) is not context free.

Get a 5 % discount on an order above $ 150
Use the following coupon code :
Computer Theory
Violent Video Game Regulation

Category: sample papers

Our Services:
Order a customized paper today!
Open chat
Hello, we are here to help with your assignments