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

Consider a CFG with the following productions.
S AA | B
A 0A | A0 | 1
B 0B00 | 1
S is the start symbol, A and B are non-terminals and 0 and 1 are the terminals. The language generated by this grammar is

A
The set of all strings over {0, 1} containing at least two 0's
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
{0i10j | i,j0} {0n102n | n1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
{0n102n | n1}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
{0i10j10k | i,j,k0} {0n102n | n0}
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D {0i10j10k | i,j,k0} {0n102n | n0}
S B
B 0B00 | 1
So, S generates {0n102n | n1}
S AA
A 0A|A0|1
A {0m10n|m,n0}
So, S generates {0m10n0p10q|m,n,p,q0}.
={0m10x10q | m,x,q0}
={0i10j10k | i,j,k0}
L(S) = {0i10j10k | i,j,k0} {0n102n | n1}
Which is same as option (b).



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Visualising the Terms
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon