In the context-free grammar below, S is the start symbol, a and b are terminals, and ϵ denotes the empty strings S→aSAb | ϵ A→ bA | ϵ
The grammar generates the language
A
{ambn|m=n}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
{ambn|m≤n}
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
((a+b)∗b)∗
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
a∗b∗
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is B {ambn|m≤n} A→bA|ϵ
L(A) = b* S→aSAb|ϵ
Now, substituting A solution into this gives S→aSb∗b|ϵ S→aSb|aSbb|aSbbb...|ϵ
L(S) = {ambn|m≤n}