1
$\begingroup$

I've been tasked with solving this problem, but I'm not sure where to begin:

Let $L$ be a context-free language. $L'$ contains all the words that belong to $L$ which can't be defined as $z=uvwxy$, for which $|vx|>0$ so that $\forall i \ge0$ we get $uv^iwx^iy\in L$.

Is $L'$ a regular language, context free but not regular or not context free? Prove your answer.

So the immediate thought that occurs to me, this doesn't follow the pumping lemma for context free languages, but I suppose the answer isn't THAT immediate, right?

EDIT: I see now that they omitted the part where exists a natural number $n$ for which $|vwx|<n$, but I cannot seem to connect this information with the proof.

Can you please give me some more insight to the problem? Thanks!

$\endgroup$
2

1 Answer 1

2
$\begingroup$

Since $L$ is a context-free language, there must be some integer $p \ge 1$ such that any word $z \in L$ such that $|z| \ge p$ can be written as $z = uvwxy$ with $|vx|>0$ and $uv^iwx^iy \in L$ for all $i \ge 0$.

This means that no word $z$ with $|z| \ge p$ can be in $L'$ and hence $|L'| \le \sum_{i=0}^{p-1} |\Sigma|^i \le p |\Sigma|^{p-1}$. Therefore $L'$ is a finite language and, as such, it is regular (and context-free).

$\endgroup$
1
  • $\begingroup$ I was thinking it might only be context-free, as $L'=L \cap \{ w \in \Sigma^* | |w| < n \}$ but your tip regarding $L'$ being a finite language saved me. Thanks, Steven. $\endgroup$ Jul 14, 2022 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.