Consider the following context-free grammar with terminals {a, b, c, d} and start symbol S.
S → W | X | Y | Z
W → AW D | X | Y | Z
X → BXD | Z
Y → AY C | Z
Z → BZC | ε
A → a
B → b
C → c
D → d
(a) Give a derivation tree with input string: aaaabccddd
(b) What language does this CFG recognize? Give a precise, mathematical definition

Please up vote.
Consider the following context-free grammar with terminals {a, b, c, d} and start symbol S. S...
Consider the following regular grammar with start symbol S and terminals {x, y}. S → xS S → yX S → yY X → xX X → yS Y → xY Y → λ List four strings, each of length less than 4, accepted by this grammar. (Include ε if it is accepted.) List four strings, each of length less than 4, not accepted by this grammar. (Include ε if it is not accepted.) In English, describe the language represented...
Given the following ambiguous context free grammar (3x20) 1. (a) Explain why the grammar is ambiguous (b) Find an equivalent unambiguous context-free grammar. (c) Give the unique leftmost derivation and derivation tree for the string s generated from the unambiguous grammar above. 2. Construct non-deterministic pushdown automata to accept the following language (20) 3. Convert the following CFG into an cquivalent CFG in Chomsky Normal Form (CNF) (20)-
2. Consider the following context free grammar with terminals (), +, id, num, and starting symbol S. S (ST) F-id Fnum a. Compute the first and follow set of all non-terminals (use recursion or iteration, show all the steps) Show step-by-step (the parsing tree) how the following program is parsed: (num+num+id)) b.
3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the string. 3 points) (4 poiots) (5 points) (3 points) sECTION IWOLAttcmpt.any 3.(or 2) questions from this.scction Suppose we have two tokens: (1) the keyword if, and (2) id-entifiers, which are strings of letters other than if. Show the DFA for these tokens. Give a nightmost derivation for the string. Give a parse tree for the string i) Is...
Given the following grammar with start symbol : ?: ? → b? | a? ? → a? | ε a) Give two strings derived from this grammar and their corresponding derivations. (Please mention the derivation as well).
The following context-free grammar (CFG) generates palindromes. This CFG has the following rules: S → ε, S → a, S → b, ..., S → z, S → aSa, S → bSb, ..., S → zSz. On an example of a palindrome cattac, show, step-by-step, how this palindrome will be generated by this grammar.
2. The following context-free grammar (CFG) has A-productions. S + XY | XYZ X + YXYZ | a | A Y + XZ | ZY | 6 | A Z YZ | XY | X | C Using the algorithm in Chapter 13, find another CFG that generates the same language except for the empty word, and that does not have any A-productions.
10 pt) Consider the following grammar where S is the start variable » terminals: x, y, z,t,,* non-terminals: El T, F, V * start symbol: E production rules (a) (4 pt) What is the associativity of the operators+,, * and/ explain why. (b) (3 pt) What is the precedence of , and / explain why (c) (3 pt) Given a parse tree F * T 2 2 Explain how the value of the string is generated
Give a Context Free Grammar (CFG) for the following language: L = { w | the number of a’s and the number of b’s in w are equal, ∑= {a, b} }
IN HASKELL Consider a context-free grammar with nonterminal symbols: sentence (the start symbol), noun-phrase, verb-phrase, article, noun, and verb; terminal symbols: "." (period), "a", "the", "girl", "dog", "sees", and "pets"; and the following rules: sentence = noun-phrase verb-phrase "." . noun-phrase = article noun . article = "a" | "the" . noun = "girl" | "dog" . verb-phrase = verb noun-phrase . verb = "sees" | "pets" . a. Give a left-most derivation of the sentence: a girl pets the...