Consider the following languages: L1 = {ww w ∈ {a,b}*} L2 = {an bn cm m, n ≥ 0} L3 = {am bn cn m, n ≥ 0} Which of the following statements is/are FALSE?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2022 · Q48
Time
Select all that applyOne or more correct
Solution
Official answer: B) Neither L1 nor L2 is context-free.; C) L2, L3 and L2 ∩ L3 all are context-free.; D) Neither L1 nor its complement is context-free.
Context-Free Grammars and PDAsLet us analyze each language and statement:
Language properties:
is a well-known non-context-free language (provable by the Pumping Lemma for CFLs). However, its complement is context-free because any string not in is either of odd length, or of even length where there exists some position () such that the -th symbol differs from the -th symbol.
is a Deterministic Context-Free Language (DCFL) because a DPDA can push all 's, match and pop with 's, and then consume 's.
is also a DCFL.
, which is well known to be non-context-free.
Evaluating the options:
Statement (A): " is not context-free but and are deterministic context-free." — This statement is TRUE.
Statement (B): "Neither nor is context-free." — This statement is FALSE because is context-free.
Statement (C): ", and all are context-free." — This statement is FALSE because is not context-free.
Statement (D): "Neither nor its complement is context-free." — This statement is FALSE because the complement of is context-free.
Since the question asks which statements are FALSE, the correct choices are B, C, and D.
Try the question first, then check your work.
Examiner trap
Recall that CFLs are not closed under intersection. Also, check whether the complement of can be recognized by a non-deterministic pushdown automaton.
This Context-Free Grammars and PDAs previous year question is Q48 of the GATE CSE 2022 paper. Find more GATE CSE PYQs on Context-Free Grammars and PDAs in Theory of Computation, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Context-Free Grammars and PDAs PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Context-Free Grammars and PDAs has 26 GATE CSE PYQs across 17 papers from 2011 to 2026. 4 of them are 2-mark MSQs like this one, and it is the only one in GATE CSE 2022.
How GATE tests Context-Free Grammars and PDAsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.