this is the language:
L = { w belong {a,b,c}* | |w|= 3 * number(a) (w) }
Then, what does that mean?
It means that L is the language of strings w
consisting of symbols 'a'
, 'b'
' and 'c'
, where the length of the string w
equals to 3 times the number of symbol 'a'
present in the string w
.
The productions for this grammars should be such that if it add one 'a'
then it also adds two 'b'
, or two 'c'
, or one 'b'
; one 'c'
. Check below grammar:
S → ^ | SaSMSM | SMSaSM | SMSMSa
M → b | c
here ^
means epsilon.
To generate aabbcc
use Right most derivation
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.