In case below, find a CFG generating the giving language. The set of even-length
ID: 3639261 • Letter: I
Question
In case below, find a CFG generating the giving language.The set of even-length strings in {a, b}* with the two middle symbols equal
Explanation / Answer
the CFG with two middle symbols equal are : S -> aSa | bSb | aSb | bSa | e. where S is the starting state. and by the above rule u can guarantee that the for every insertion of S u can be sure that u are adding 2 letters on either side of S, so that even number is maintained (exclude the S) and then insert e to get the desired string . example : abaaab is the string in which middle letters are same : rules are S -> aSb -> abSab -> abaSaab -> abaaab. done!
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.