[Math] CFG with reverse strings

context-free-grammarformal-languagesregular-language

I've been trying to figure this out for a while, and I'm at a total loss:

Write a context-free grammar that generates the language $\{x y\ |\ x$ is a
string over $\{a,b,c\},\ y$ is a reverse of $x\}$.

Best Answer

How about this one:

$$S\rightarrow \lambda,\quad S\rightarrow aSa,\quad S\rightarrow bSb,\quad S\rightarrow cSc$$