Context-Free Grammars & Languages

Answer & solution
Answer: B (no official key was published)
The base productions produce a single a or b. Every recursive production adds the same symbol at both ends, preserving the palindrome property and odd length. Conversely strip matching outer pairs from any odd palindrome until one central symbol remains, yielding a derivation. Thus exactly all odd-length palindromes, B.
Every derivation starts from a one-symbol base a or b and adds matching symbols around the outside. Length therefore remains odd and the string remains a palindrome. Conversely, removing the equal end symbols from any odd palindrome repeatedly reaches its one-symbol centre, giving a reverse derivation. Even palindromes are excluded because no ε base exists; a string such as aabba begins/ends alike but is not generated.