Proof that the language $a^nb^ma^nb^m$ is not context free using the pumping lemma.

1.6k Views Asked by At

I need a proof that the language L = {$a^nb^ma^nb^m,\:n,m\geq0$} is context free using the pumping lemma. My problem is that I can actually show the conditions of the lemma hold for this language and thus it wouldn't help in disproving the context freeness of this language. In order to do that, I can take $s=uvxyz$ to be $u=a^nb^{m-1}$, $v=b$, $x=a^n$, $y=b$, and $z=b^{m-1}$ and let the constant $p$ (or $m$ in some references) be $p=n+2$; then no matter how I pump $v$ and $y$ up or down, still the number of $b$s would be the same on both sides and with the same order and the resulting string would still be in L. What am I doing wrong here?

2

There are 2 best solutions below

7
On BEST ANSWER

Suppose $L$ is a CFL with pumping length $p \geq 1$.

Then consider the string $s = a^pb^pa^pb^p$. Clearly $|s| \geq p$. Let $s'$ be the pumped string. For $s' \in L$, either $v = x = b \lor v = x = a$ where $v$ and $x$ are taken from different occurrences of $b$ and $a$ respectively. But in this case $|vwx| \geq p+2$. Qed.

1
On

If $L$ is a CFL, there is a constant $N$ so that all strings in $L$ longer than $N$ can be divided as $u v w x y$, with $\lvert v w x \rvert \le N$ and $v x \ne \varepsilon$ so that for all $k\ge0$ it is $u v^k w x^k y \in L$. You want to contradict this. Assume $L$ is a CFL, let $N$ be the lemma's constant for $L$. Pick some "easy" string in $L$, say $a^N b^N a^N b^N$. Any division you may pick won't work with e.g. $k = 0$ (the parts pumped don't reach far enough to balance the pieces). Contradiction, $L$ isn't a CFL.