Circle the context free grammars that describe the following language? You do no
ID: 3581289 • Letter: C
Question
Circle the context free grammars that describe the following language? You do not need to prove your answer. L_2 = {w over {a, 6} | w has the same number of a's and b's) Grammar 1 S rightarrow aSb | bSa | SS | epsilon Grammar 2 S rightarrow aSb | bSa | abS | baS | Sab | Sba | epsilon Grammar 3 S rightarrow aSbS | bSaS | epsilon Grammar 4 A rightarrow aB | bA | epsilon A rightarrow a | aS | bAA B rightarrow b | bS | aBB Grammar 5 S rightarrow TS | US | epsilon T rightarrow aTb | ab U rightarrow bUa | baExplanation / Answer
Solution:
L2= {w over {a, b} | w has the same number of a's and b's}
Grammar 1
s aSb | bSa | SS |
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.