Question 5 1 pts Consider the production rules: S aSa The goal is to have a gram
ID: 3878469 • Letter: Q
Question
Question 5 1 pts Consider the production rules: S aSa The goal is to have a grammar that defines the language of palindromes over the alphabet {a, b}. (Palindromes are strings that read the same from left to right and from right to left. For instance, A,a, aa, aba are palindromes and abab is not.) The three productions above are not sufficient. Which two additional rules are necessary to have a grammar for the language of palindromes? Below I give four possibilities, For each, determine whether it does the job (properly complements the three top rules). a. [Select ] works/Doesn't work a I Select ] Works/Doesn't work C. Sa Select] Works/Doesn't work d. S bbSbb Sa [ Select ] Works/Doesn't workExplanation / Answer
a) doesn't work
Explanation : it can generate any number of b's
b) doesn't work
Explanation : can't generate b's
C)works
Explanation : it can perfectly generates palindromes over a's and b's
d) doesn't works
Explanation : only generates 4 multiple length b's
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.