Consider the language L1 = {0i1j|i≠j}, L2 = {0i1ji=j}, L3 = 0i1j|i=2j+1}, L4 = {0i1j|i≠2j}.
Which of the following statements is true?
A
All are context free
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
Only L1 and L2 are context free
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Only L2 is context free
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Only L2 and L3 are context free
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is A All are context free L1={0i;1j;i≠j} L2={0i;1j;i=j} L3={0i;1j;i=2j+1} L4={0i;1j;i≠2j}
All of L1,L2,L3 and L4 are context free,since ,each of these languages has a single linear comparision between i and j and any linear comparison between i and j can be perfomed,in a PDA.