In: Computer Science
Give context free grammars for the languages below. To avoid mistakes, I recommend using scratch paper to check that your grammars produce the right set of string. This question is structured so that nonterminals (and associated rules) from an earlier subquestion might be useful in a grammar for a later sub-question. That’s why, rather than “S” as the start symbol, we will used different start symbols for each part. If you do use a nonterminal from an earlier sub-question, say something like “see part a”.
Let sigma ( Σ ) be the set {a, b}
d. Strings over sigma that contain exactly two b's (and any number of a's) Use V as your start symbol
e. Strings over sigma that contain exactly three b’s (and any number of a's) Use W as your start symbol.
f) Strings over sigma that contain at most three b's (and any number of a's). Use X as your start symbol
Here, you have not provided option no. a),b) and c). So initially I'm solving from d). If any doubt you can ask anytime.