# Computer Theory

| October 23, 2015
1. Consider the grammar G: `S → a S b S | b S a S | ε`
1. Describe in English the language generated by G.
2. Prove that G generates precisely this language.
4. 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 | pr or qr }, 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 :
2020Discount

Category: sample papers

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