GateAI
Regular and Context-Free Languages

GATE CSE 2011 · Q24

MCQ1 markEasy

Time

Let PP be a regular language and QQ be a context-free language such that Q⊆PQ \subseteq P. (For example, let PP be the language represented by the regular expression p∗q∗p^*q^* and QQ be {pnqn∣n∈N}\{p^n q^n \mid n \in \mathbb{N}\}). Then which of the following is **ALWAYS** regular?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) * - P

Regular and Context-Free Languages

Let us check the regularity of each given option:

  1. **Option (C) Σ∗−P\Sigma^* - P:**

    • Σ∗−P\Sigma^* - P is the complement of language PP, denoted as P‾\overline{P}.

    • Regular languages are closed under complementation. Since PP is given to be regular, its complement Σ∗−P\Sigma^* - P is always regular.

  2. Option (A) P∩QP \cap Q:

    • Since Q⊆PQ \subseteq P, we have P∩Q=QP \cap Q = Q.

    • QQ is given to be a context-free language, which is not necessarily regular (e.g., Q={pnqn∣n∈N}Q = \{p^n q^n \mid n \in \mathbb{N}\} is context-free but not regular). Thus, P∩QP \cap Q is not always regular.

  3. Option (B) P−QP - Q:

    • For P=p∗q∗P = p^*q^* and Q={pnqn∣n∈N}Q = \{p^n q^n \mid n \in \mathbb{N}\}, $P - Q = \{p^i q^j \mid i

e j\}$, which is not regular.

  1. **Option (D) Σ∗−Q\Sigma^* - Q:**

    • Context-free languages are not closed under complementation, and the complement of a non-regular CFL is generally not regular.

Therefore, (C) is always regular.

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 Q24 of the GATE CSE 2011 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. 5 of them are 1-mark MCQs like this one, and GATE CSE 2011 has 2.

How GATE tests Regular and Context-Free Languages

More from GATE CSE 2011

Share this solution

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

GateAI solution cardGATE CSE 2011 · Q24 · MCQ

Let P be a regular language and Q be a context-free language such that Q ⊆ P. (For example, let P be the language represented by the regular expression p*q* and Q be {pn qn n ∈ N}). Then which of the following is ALWAYS regular?

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.