w ∈ C*
"Generate a Grammar such that w contains strings of as followed by bs followed by cs such that there are either a different number of as and bs or a different number of bs and cs or both"
C= {a,b,c}
I am trying to do both. I'm having difficulties generating grammars, but I have understood that I should just write down some strings and from there try to generate some rules.
some of my strings are aabc, abbc, abcc, aabbbcc
I have produced the following rules:
$S\rightarrow aSbScS$
$S\rightarrow AS$
$S\rightarrow SB$
$S\rightarrow SC$
$S\rightarrow e$
$A\rightarrow a$
$B\rightarrow b$
$C\rightarrow c$
Did I do this right? And if not, what did I do wrong?
I am a language student and am trying to make my brain get used to such thinking, but I am somehow struggling with this.
Thank you.