Subset of Context Free Language with Strings Starting and Ending in Same Symbol is Context Free

239 Views Asked by At

This was a question asked in a previous exam that I'm studying. Assume $L$ is a context free language (CFL). Let $L_{a..a}$ be a subset of $L$ s.t. all strings in $L_{a..a}$ start and end with the same character. Prove that $L_{a..a}$ is a CFL.

I tried to use Chomsky Normal form of $L$ but couldn't get anywhere. This can be proved using either grammars or PDA.

Any suggestions how this might be proven?

1

There are 1 best solutions below

2
On

Hint. If $A$ is the alphabet and $a \in A$, then $L_{a..a} = L \cap aA^*a$.