Consider the following grammar. Nonterminals are lowercase and
terminals are uppercase.
s -> c A
c -> c B | B
Which of the following sentences is in the language generated by
the grammar?
a) BAA
b) BBBA
c) BBAAAAA
d) none of the above
b) BBBA Explanation: ------------- s -> cA -> cBA -> cBBA -> BBBA so, BBBA is generated by this grammar this language generates strings in the pattern of one or more B's and then ends with a single A but BAA ends with two A's and BBAAAAA ends with 5 A's. these two can't be generated by this grammar
Get Answers For Free
Most questions answered within 1 hours.