2

The question is from my homework: Is the language $\{a^ib^jc^k\mid i,j,k\geq0\land i\neq j \land j \neq p\}$ a context-free language (CFL)? If yes, please provide a context-free grammar for it. I found this question quite challenging, so I decided to post it here.

My attempts:

  1. First I tried to show the language is not a CFL using the pumping lemma. I tried with $a^kb^{2k}c^k$, $a^kb^{k+1}c^{k+2}$ but all failed to pump out of the language.
  2. I understand that pumping lemma says nothing about the language is context-free. But I failed to prove it / disprove it.
  3. Then I tried to look for a context-free grammar for it. But my grammar is always possible to generate a word that is not in the language.
  4. I tried to search for an answer, but I just found the answer for $\{a^ib^jc^k|i,j,k\geq0,i\neq j \lor j \neq p\}$. The "and" and "or" sure makes a difference, so I don't think this answer is helpful.
John L.
  • 39,205
  • 4
  • 34
  • 93

0 Answers0