a)String is 1
leftmost derivation i)
S->A
->1S
->1A
->1
leftmost derivation ii)
S->A
->1S
->1B
->1
two leftmost derivations for string 1
so the grammar is ambigous.
b)
S —> A becomes
S->AX
X-> ^
S->B becomes
S->BX
A->1S becomes
A->YS
Y->1
A->^ is same
B->0S becomes
B->ZS
Z->0
B->^ is same
chomsky normal form is
S->AX
X-> ^
S->BX
A->YS
Y->1
A->^
B->ZS
Z->0
B->^
Please help with the following context free grammar over alphabet (0,1): S —> A | B...
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)-
Need help with Theory of Computation.
i
think ^ is an epsilon.
Grade: Name: CSCI 4333 Theory of Computation Final December 4th, 2019 Part I. Short answer/problems. Answer all questions. Long rambling answer will be marked as incorrect Point values in parenthsis. 1. Given the following context free grammar over alphabet (a,b): S -> ABa A -> aab | BI B -> Ab | aa a. (6) Show that the grammar is ambiguous for a non-empty string b. (10) Convert...
Please help and show full steps will upvote thanks!
Define a context-free grammar (CFG) that generates exactly the following language. B = {1'0'ik | i+j = k or i+k=j with i, j, k > 0} Both ambiguous and unambiguous grammars are acceptable (it does not matter in this question). For grading purposes, please use as the starting variable. Alphabet E = {0,1}
Q1: Given the below language and context free gramma:, a. Show that the grammar is ambiguous using the string ( abc) by using substitutions. b. Then design a push down automata that recognizes the language. C. Then show the tracing of (abc, abbccc) using the push down automata. d. Then Show which two simple languages create the greaterlanguage. Give set builder notation for each language. e. Then produce Chomsky normal form for the grammar. The following context-free language is inherently...
Give a context-free-grammar describing the syntax of the
following language.
Thank you =)
Give a context-free-grammar describing the syntax of the following language: L = { ww| we{a, b }" } is a context- free language, where w is a non-empty string from alphabet {a, b } and wt denotes the reversal of string w.
Convert the context free grammar to an equivalent grammar in Chomsky normal form: (show your work) S → AxAyA | BC A → BB | a B → bd | ε C → SC | c
The following shows a context-free Tammar on {0, 1}. Show that the grammar is ambiguous by generating 2 derivation sequences for word 00111. S > AS5 A → Al|0A101 The following is a context-free grammar on alphabet {a}. Use the string a +a- a to verify whether or not the grammar is ambiguous. AA+AA-AA The following is a gamar equivalent to the one shown above in problem (5). Is it ambiguous? Use a +a- a to verify it. A →...
Convert the following context free grammar G to Chomsky normal form. G:S → AB A → aAb|B2 B → BA2
The context free grammar for L = {(an)(bm)(ck) : k ≠ n + m; n, m, k ≥ 0} is n+m < k S1-> aS1c|cS1|cB B->bS1C|λ n+m > k S2 -> aS2c|aS2|bS2|a|b|B B-> bBc|λ Convert the cfg to chomsky reduced normal form.
1)Convert the following context free grammar to Chomsky Normal Form S → a X | Yb X → S | λ Y → b Y | λ 2)Some languages distinguish between uppercase and lowercase in identifiers. What are the pros and cons of this design decision? 3)Use the pumping lemma to prove that the following languages are not regular. (The alphabet is Σ = {a, b}.) a) L = {an b1 ak: k >= n+ l} b) L = {ww:...