GateAI
Regular and Context-Free Languages

GATE CSE 2026 Set 1 · Q51

MSQ2 marksMedium

Time

Let L1L_1 and L2L_2 be two languages over a finite alphabet, such that L1∩L2L_1 \cap L_2 and L2L_2 are regular languages. Which of the following statements is/are always true?

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: C) L2 is context-free

Regular and Context-Free Languages

We are given that L2L_2 and L1∩L2L_1 \cap L_2 are regular languages over a finite alphabet Σ\Sigma.

  1. Option (C) is always true:

    • Regular languages are closed under complementation. Since L2L_2 is regular, its complement L2‾=Σ∗∖L2\overline{L_2} = \Sigma^* \setminus L_2 is also a regular language.

    • Every regular language is a context-free language (regular languages are a proper subset of context-free languages).

    • Therefore, L2‾\overline{L_2} is always context-free.

  2. Counterexample for Options (A), (B), and (D):

    • Let L2=∅L_2 = \emptyset, which is a regular language.

    • For any arbitrary language L1L_1, the intersection L1∩L2=L1∩∅=∅L_1 \cap L_2 = L_1 \cap \emptyset = \emptyset, which is also regular, satisfying the given conditions.

    • If we choose L1={anbncn∣n≥0}L_1 = \{a^n b^n c^n \mid n \ge 0\} (or any non-context-free / undecidable language):

      • L1L_1 is not regular (disproving A).

      • L1∪L2=L1∪∅=L1L_1 \cup L_2 = L_1 \cup \emptyset = L_1, which is not regular (disproving B).

      • L1L_1 is not context-free (disproving D).

Hence, only statement (C) is always true.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Regular and Context-Free Languages previous year question is Q51 of the GATE CSE 2026 Set 1 paper. Find more GATE CSE PYQs on Regular and Context-Free Languages in Theory of Computation, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Regular and Context-Free Languages PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Regular and Context-Free Languages in GATE CSE

Regular and Context-Free Languages has 21 GATE CSE PYQs across 13 papers from 2011 to 2026. 4 of them are 2-mark MSQs like this one, and it is the only one in GATE CSE 2026 Set 1.

How GATE tests Regular and Context-Free Languages

More from GATE CSE 2026 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2026 Set 1 · Q51 · MSQ

Let L1 and L2 be two languages over a finite alphabet, such that L1 ∩ L2 and L2 are regular languages. Which of the following statements is/are always true?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.