CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

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,n1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
{(a,b)n(cb)n | n1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
{(a,b)n(cbn)m | m,n1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
{(a,b)ncbm1 cbm2...cbmn | n,m1,m2,...,mn1}
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)ncbm1 cbm2...cbmn | n,m1,m2,...,mn1}
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 | n1}
Which is nothing but {(ab)ncbm1cbm2....cbmn | n,m1,m2,....mn1}

flag
Suggest Corrections
thumbs-up
1
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Construction of CFG Part - 2
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon