Skip to content
Related Articles

Related Articles

Improve Article
GATE | GATE CS 2010 | Question 40
  • Last Updated : 21 Dec, 2013

Consider the languages
L1 = {0i1j | i != j}.
L2 = {0i1j | i = j}.
L3 = {0i1j | i = 2j+1}.
L4 = {0i1j | i != 2j}.
(A) Only L2 is context free
(B) Only L2 and L3 are context free
(C) Only L1 and L2 are context free
(D) All are context free

Answer: (D)


All these languages have valid CFGs that can derive them. Hence, all of them are CFLs. Intuitively,
(A) & (B) are well known CFLs and CFGs for (C) & (D) could be made by little modifications in
A & B’s CFGs.




This solution is contributed by vineet purswani.

Quiz of this Question

Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :