1

I am studying CFL at the moment and I found this confusing. What I've just read is that, $L=\{ww\}$ is not a CFL. The proof showed it by using pumping lemma for CFL. ($w=0^n1^n0^n1^n$) and I fully understood the proof.

Here comes the question. I understand that $L1=\{ww^R\}$ can be constructed by NPDA, and thus a CFL. However, if I use pumping lemma for this, i.e., $w=0^n1^n1^n0^n$, I can show that this specific sentence does not satisfy pumping lemma as well.

Pumping lemma

Let $L1$ be a CFL. Then, there exists n such that for any $w ∈ L$ and $|w|\geq n$, $w$ can be decomposed as $w=uvxyz$ such that

1) $|vxy|\leq n$

2) $|vy| \geq 1$

3) $w_i=uv^ixy^iz$ ∈ $L1$, for all $i \geq 0$

By setting $w=0^n1^n1^n0^n$ and if $v,y$ ∈ $0^+$ in the first half, regardless of how many times I pump, $ww^R$ does not belong to $L1$ anymore. Thus, since the pumping lemma should be satisfied for every possible case, I can conclude that it is not CFL.

Note again that I know $L1$ can be designed with NPDA. What is my mistake while proving using pumping lemma?

I am really confused about this. Can anyone answer my question?

My first guess is...

In order to show a language is CFL, I should first try to construct a PDA accepting the language, and if it is not possible, I should show that it is not a CFL by using pumping lemma. However, what if I could not find a PDA although there exists one?

P.S. I actually posted this question yesterday with not much detailed explanation, therefore I posted again.

Thanks in advance

Raphael
  • 73,212
  • 30
  • 182
  • 400
Mansumen
  • 43
  • 1
  • 7

1 Answers1

3

You are right in one thing. You can't pump the first half. But you clearly are confusing the pumping lemma for CFL with the version for regular languages. As you wrote the decomposition of $w$ is $uvxyz$. You can use a large substring $u$ to pump in the second half of $w$ but that generate the same conclusion as pumping the first half. What to do then? You can pump in the half of the word. Each time you add a 1 in the first half you can add a 1 in the second half so the decomposition exist and you can´t say that $L1$ is not CFL.

Summarizing the decomposition exists. For example:

$u=0^n1^{n-1}$

$v=1$

$x=\epsilon$

$y=1$

$z=1^{n-1}0^n$

So we can't conclude anything from the pumping lemma. It is time to choose another word to try it again or generate a PDA to prove that $L1$ is CFL.

Renato Sanhueza
  • 1,345
  • 8
  • 21