0

I am trying to use the pumping lemma to show this is not a context free language $$ L = \{a^n b^{2n} a^n\mid n\ge 0\} $$

My idea is fist assume it is a CFG language and let $n$ be the pumping lemma integer.

Then let $u=a^n b^{2n} a^n$ be a string. I am going to use to prove it is not a cfg language

Since $u=vwxyz$ and must follow all three conditions for the lemma.

So

$|wy|>0$ and $|wxy|\le n$ thus now I chose the first group of $a$ in the left of my string

and do

$vw^2xy^2z$ since $wy$ cannot include $b$, my $wxy$ string includes all $a$.

So then

$v w^2 x^2 z\notin L$ because $a^{n+1} b^{2n} a^n$ is not in language.

But am I correct?

Raphael
  • 72,336
  • 29
  • 179
  • 389
  • 2
    You don't get to pick where the substring $wxy$ resides; you have to get a contradiction in every possible case. In this problem there are five places where $wxy$ may be: (1) in the first group of $a$s, (2) overlapping the first group $a$s and the $b$s, (3) in the $b$s, (4) overlapping the $b$s and the second group of $a$s, and (5) in the last group of $a$s. – Rick Decker Apr 12 '15 at 21:24
  • There's no way to assign w, x, and y no matter what p is. W and y have to contain all three sections of the string, the same amount of as from each side, and the same number of bs as as. One of them has to contain both bs and as. Try multiplying that. It immediately breaks the grammar. – Millie Smith Apr 13 '15 at 04:30

0 Answers0