UGC-NET | UGC-NET CS 2017 Nov – III | Question 63
Consider the following languages:
L1 = {am bn │ m ≠ n}
L2 = {am bn │ m = 2n+1}
L3 = {am bm │ m ≠ 2n}
Which one of the following statement is correct ?
(A) Only L1 and L2 are context free languages
(B) Only L1 and L3 are context free languages
(C) Only L2 and L3 are context free languages
(D) L1, L2 and L3 are context free languages
Answer: (D)
Explanation:
- In L1 we have to check for m is not equal to n. there are infinite no which falls under this category but we have only one comparision with m and n. So it is context free language.
- In L2 one comparison with infinite possibilities of m and n, it is alos a CFL
- In L3 one comparison with infinite possibilities of m and n, it is alos a CFL
So, option (D) is correct.
Quiz of this Question



