The language which is generated by the grammar S → aSa | bSb | a | b over the alphabet {a, b} is the set of
The language which is generated by the grammar S → aSa | bSb | a | b over the alphabet {a, b} is the set of Correct Answer All odd length palindromes
Concept:
S → aSa | bSb | a | b generates strings like {a, b, aaa, bbb, aba, bab, abbba, ababa, ….) which is the set of all odd length palindromes.
Example of odd length pallindrom.
String: ababa
[ alt="F1 R.S 20.5.20 Pallavi D1" f: image at pm.jpeg src="//storage.googleapis.com/tb-img/production/20/05/F1_R.S_20.5.20_Pallavi_D1.png" style="width: 136px; height: 178px;">
Option 1: Incorrect
String: “aa” (Not accepted)
Begins and ends with same symbol but not accepted by given grammar
Option 2 and 4: Incorrect
String: “aa” (Not accepted)
Even length palindrome is not accepted by given grammar
মোঃ আরিফুল ইসলাম
Feb 20, 2025