0

For n>=0, is the given grammar (a^na^na^n) context free? I tried using pumping lemma, and the result was, no it is not context free.

  • 2
    If you can prove that it's not context free with the pumping lemma, then it's not context free. If you want someone to verify your proof, you should include the proof in the question. But stackoverflow is not an appropriate place to ask people to verify proofs, since that has nothing to do with programming; you might want to try http://cs.stackexchange.com/ – rici Apr 01 '15 at 03:34

1 Answers1

0

For the pumping lemma to work you need to show, that you can find a word and "pump it up" in order to break the rules of the PL.

In this case you have a^n a^n a^n and want to split those words into a word uv^kw so that it still will be in the specified grammar.

In this case it will NOT work!

To see this we have to think about several cases:

1) u is at least 1 (as v cant be empty by definition of PL), making v and w the rest of the a's

2) u has the lenght a^n, v has the length of at least a^n and w has the length of a^n

3) ...

Imagine you have a stencil of length k and put it under every imaginable position of the a^n a^n a^n like so:

Pumping Lemma

If you add only 1 n, the resulting word wont be anymore in a^n a^n a^n, therefore the PL fails. The language a^n a^n a^n equals a^n b^n c^n which is the standard example for a failing PL.

Sidenote: If the PL does NOT fail you cant conclude that the grammar is context-free. The PL only works into one direction.

hamena314
  • 2,969
  • 5
  • 30
  • 57