0

Please help me in making a CFG for this language.

a^i b^j c^k where i<j+k

I am fed up of trying this but not able to complete it.

Melissa Avery-Weir
  • 1,357
  • 2
  • 16
  • 47
william
  • 3
  • 2
  • Can you add one (or more!) attempts you've made? It'll help folks know where you're struggling and how to help you. – Melissa Avery-Weir Oct 30 '15 at 16:29
  • I have done this S-> 0S1/0S2/1S/S2/1/2 but thing is that I am not getting how to force order in this cfg so that a comes before b and b comes before c – william Oct 30 '15 at 18:28
  • 1
    I'm voting to close this question as off-topic because it is best suited for CS Stack Exchange. – Am_I_Helpful Nov 04 '15 at 19:38
  • 1
    This question might be better suited for the [Computer Science StackExchange](https://cs.stackexchange.com/) as it seems to be about programming theory. Remember to read [their question requirements](https://cs.stackexchange.com/help/on-topic) as they are more strict than this site. – Kyll Nov 04 '15 at 19:41

1 Answers1

0
S -> Ac | Bb
A -> Ac | aAc | B
B -> Bb | aBb | ε

You "force order" by first generating as many cs as you need before moving on to bs.

blurry
  • 114
  • 2
  • 9