GateAI
Regular and Context-Free Languages

GATE CSE 2013 · Q32

MCQ2 marksMedium

Time

Consider the following languages. L1={0p1q0r∣p,q,r≥0}L_1 = \{0^p 1^q 0^r \mid p,q,r \ge 0\} L2={0p1q0r∣p,q,r≥0,per}L_2 = \{0^p 1^q 0^r \mid p,q,r \ge 0, p e r\} Which one of the following statements is FALSE?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) Complement of L1 is context-free but not regular.

Regular and Context-Free Languages

Let us analyze each statement:

  1. Nature of L1L_1: L1={0p1q0r∣p,q,r≥0}=0∗1∗0∗L_1 = \{0^p 1^q 0^r \mid p, q, r \ge 0\} = 0^* 1^* 0^*, which is a regular language.

  2. Complement of L1L_1: Since regular languages are closed under complementation, the complement of L1L_1 is also regular (and hence context-free). Statement (D) claims that the complement of L1L_1 is context-free *but not regular*, which is FALSE.

  3. Nature of L2L_2: $L_2 = \{0^p 1^q 0^r \mid p

e r\}canbeparsedusingadeterministicpushdownautomaton(bymatchingthenumberofleading can be parsed using a deterministic pushdown automaton (by matching the number of leading 0′swithtrailing's with trailing 0′sandensuringtheyarenotequal).Thus,'s and ensuring they are not equal). Thus, L_2$ is a deterministic context-free language (DCFL), so (A) is true.

  1. Intersection L1∩L2L_1 \cap L_2: Since L2⊆L1L_2 \subseteq L_1, L1∩L2=L2L_1 \cap L_2 = L_2, which is context-free, making (B) true.

  2. Complement of L2L_2: DCFLs are closed under complement, so the complement of L2L_2 is a DCFL, and all context-free languages are recursive (decidable), making (C) true.

Therefore, the statement that is FALSE is (D).

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 Q32 of the GATE CSE 2013 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. 9 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2013.

How GATE tests Regular and Context-Free Languages

More from GATE CSE 2013

Share this solution

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

GateAI solution cardGATE CSE 2013 · Q32 · MCQ

Consider the following languages. L1 = {0p 1q 0r p,q,r ≥ 0} L2 = {0p 1q 0r p,q,r ≥ 0, p e r} Which one of the following statements is FALSE?

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.