Question 2: a. Give the context free grammars that generate the following languages. In both parts the alphabet S = {0, 1}
(i) {w | w contains at lest three 1’s}
(ii) {w | the length of w is odd and its middle symbol is a 0}
b. Give context free grammars generating the following languages.
(i) The set of strings over the alphabet {a, b} with more a’s than b’s
(ii) {w#w | wR is a substring of x for w, x ? {0, 1}*}
i) Generating the strings aabbaa
S => XS
aaXS
aabbXS
aabbaaL
aabbaa
ii) Generating the strings bbaabb
bbXS
bbaaXS
bbaabbL
bbaabb
About Cramster | Terms of Use | Privacy Policy | Contact Us | Press Room | Site Map | Support | Anti-Cheating Policy