1

I'm struggling to know if this Language is context free or not.

The Language is: "L={a^n*a^z*b^n*b^z*c^n*c^k|n≥0, z≥0, k≥0}".

In my opinion this language is not context/free, because I can't describe with an Automata the case where z=k=0, in this case I'd have: L = (a^n*b^n*c^n) which is clearly a not context-free Languages. But I'm not able to use the Pumping Lemma (on the starting language) and be sure of my Idea.

Luciry
  • 11
  • 2

1 Answers1

1

n serves no purpose whatsoever in that description; any string which matches the criterion also matches the criterion apbpcq with p, q ≥ 0. (Just set p = n + z; q = n + k.) And that language can be described with the context-free grammar:

S → A C
A → a A b | ε
C → C c | ε

One take-away here is that the implicit structure in an arithmetic expression is not automatically part of the thing being described by that arithmetic expression. (Or, in other words, after you concatenate two strings, you no longer see the boundary between them.) Another, possibly more practical take-away, is that most exam questions about formal languages complicate in order to make the answer non-obvious, so in a certain sense they're almost all trick questions.

rici
  • 234,347
  • 28
  • 237
  • 341