Open In App
Related Articles

GATE | GATE CS 2010 | Question 40

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
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)

Explanation:   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.   img_40   This solution is contributed by vineet purswani.

Quiz of this Question

Last Updated : 08 Oct, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads