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?
A
{(a,b)n(cbm)n|m,n≥1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
{(a,b)n(cb)n|n≥1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
{(a,b)n(cbn)m|m,n≥1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
{(a,b)ncbm1cbm2...cbmn|n,m1,m2,...,mn≥1}
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution
The correct option is D{(a,b)ncbm1cbm2...cbmn|n,m1,m2,...,mn≥1} S→abScT|abcT T→bT|b
Solving T →bb∗ will gives b+
Substitute in S to get S→abScb+|abcbb+
So, solution of S would be {(a,b)n(cb+)n|n≥1}
Which is nothing but {(ab)ncbm1cbm2....cbmn|n,m1,m2,....mn≥1}