0

Let S → ababa | aabaabaa| aaabaaabaaa | aaaabaaaabaaaa | ……

  • find the Production Rules?

I've tried like 50 rules, but I can't seem to find the right ones. can I please get a hint on how to start?

  • 2
    Could you give an example or two of the rules you have tried? – Arthur Mar 28 '23 at 20:29
  • (S → aAbaAbaA && A → Aa | ε )

    but the problem is, this allows abaabaaa for example.

    and that's the main problem that i can't solve, which is how can i make sure that i have the same number of (a's)

    – Alfa Team Mar 28 '23 at 20:34
  • Wouldnt the pumping lemma for CFL's prove that this is not generated by a CFG? – MJD Mar 28 '23 at 21:04
  • 1
    Have you considered the possibility that it's not a context-free language? Not all languages are, right? – mjqxxxx Mar 28 '23 at 21:07
  • 2
    It looks a lot like $0^n1^n2^n$, which is the canonical example of a non-CF language. – MJD Mar 28 '23 at 21:09

0 Answers0