a)answer)
a grammar is ambiguous when at least one string of the language contain more than one left or right most derivation or two parse trees exist.
string =aaba
Leftmost derivation 1:
S->ABa
=aabBa
=aaba
Leftmost derivation 2:
S->ABa
=Ba
=Aba
=Bba
=aaba
string aaba there exist two leftmost derivations. so this grammar is ambiguous.
b)answer)
S->ABa becomes
S->XY
Y->a
X->AB
A->aab becomes
A->XZ
Z->XW
W->b
A->B becomes
A->EB
E->^
A->^ is same
B->Ab becomes
B->AW
B->aa becomes
B->YY
B->^ is same
finally CNF grammar is :
S->XY
Y->a
X->AB
A->XZ
Z->XW
W->b
A->EB
E->^
A->^
B->AW
B->YY
B->^
Need help with Theory of Computation. i think ^ is an epsilon. Grade: Name: CSCI 4333...
Hi, Theory of Computation Could i please get the answer with explanation for the following, thank you. 3. Consider the following CFG with starting variable Sand Σ ={1, 2, 3,4,5,6,7,8,9,0}: S→MUV U→N|ε V→VV| N N→M| 3| 4| 5| 6| 7| 8| 9| 0 M→1| 2 b. Is this grammar ambiguous or unambiguous? Briefly explain why. c. Convert the CFG into Chomsky normal form.
Please answer any 7 of them
ТОС Answer any 7 from the followings: 1. Regular expression to NFA: i) ab(aUb)* ii) (aba U a)*ab 2. Explain and construct a generalized NFA, 3. NFA to regular expression 0 3 91 93 8 a 4. DFA to regular expression 011 5. Explain the rules of pumping lemma briefly with an example. 6. Give an example of right linear grammar and left linear grammar. 7. L(G) = {1*20 m >= 1 and >=1}....
Automata and Computability Problems
Please check my work. Make necessary edits/corrections to my
work. Please add more detail to number 2 for better understanding
:)
1. Give a context-free grammar (CFG) for each of the following languages over the alphabet = (a, b): (a) All nonempty strings that start and end with the same symbol. 2. Answer each part for the following context-free grammar. I. II. III. IV. V. R> XRXS S -ать | bТа T → XTX | X...
If L1 and L2 are Regular Languages, then L1 ∪ L2 is a CFL. Group of answer choices True False Flag this Question Question 61 pts If L1 and L2 are CFLs, then L1 ∩ L2 and L1 ∪ L2 are CFLs. Group of answer choices True False Flag this Question Question 71 pts The regular expression ((ac*)a*)* = ((aa*)c*)*. Group of answer choices True False Flag this Question Question 81 pts Some context free languages are regular. Group of answer choices True...