Consider the following context-free grammar over the alphabet ∑ = {a, b, c} with S as the start symbol: S → abScT | abcT T → bT | b Which one of the following represents the language generated by the above grammar?

Consider the following context-free grammar over the alphabet ∑ = {a, b, c} with S as the start symbol: S → abScT | abcT T → bT | b Which one of the following represents the language generated by the above grammar? Correct Answer {(𝑎𝑏)<sup>𝑛</sup> 𝑐𝑏<sup>𝑚</sup><sup>1</sup> 𝑐𝑏<sup>𝑚</sup><sup>2 </sup>… 𝑐𝑏<sup>𝑚</sup><sup>𝑛 </sup>|𝑛, 𝑚<sub>1</sub>, 𝑚<sub>2 </sub>… , 𝑚<sub>𝑛</sub> ≥ 1}

String Derivation:

S → abScT

→ ababScTcT (∵ S → abScT)

→ abababcTcTcT (∵ S → abcT)

→ abababcbTcTcT (∵ T → bT)

→ abababcbbTcTcT (∵ T → bT)

→ abababcbbbTcTcT (∵ T → bT)

→ abababcbbbbcTcT (∵ T → b)

→ abababcbbbbcbcT (∵ T → b)

→ abababcbbbbcbcbT (∵ T → bT)

→ abababcbbbbcbcbb (∵ T → b)

abababcbbbbcbcbb = (ab)3cb4cbcb2

From this string, it is clear that all the option 1),3) and 4) are not generated by given grammar.

Only option 2 matches.

Related Questions