57 views
Give CFG for the following language

L =${(a^{m})(b^{m+n})(c^{n}) | m,n= 0,1,2,.....}$
edited | 57 views
+1
understand the lang. first.
you can break this lang. into two part first a^mb^m. which can be generated by grammar A=>aAb|e.
now another part of lang. b^nc^n. grammar for this B=> aBb|e.
now join both part of grammar together with help of new symbol which will be your start symbol.
S=>AB
A=>aAb|e
B=>bBc|e.

S$\rightarrow$XY

X$\rightarrow$aXb|$\epsilon$

Y$\rightarrow$bYc | $\epsilon$
selected
+1
$abbc$?
0
Got my mistake  check it now
0
Correct (y)