Skip to content
Official PYQ · 2002

GATE CS 2002 Q2.14 — Regular and Context-free Languages

Explain with AI

Which of the following is true?

Choose one option
View worked solution

Answer: A

Let's analyze each option based on the closure properties of language families:

  1. The complement of a recursive language is recursive:
    True. Recursive languages (decidable languages) are closed under complementation. If a language LL is decided by a Turing Machine MM (which halts on all inputs), we can construct a Turing Machine M′M' to decide the complement L‾\overline{L} by swapping the accepting and non-accepting halting states of MM. Since MM always halts, M′M' also always halts. Thus, L‾\overline{L} is recursive.
  2. The complement of a recursively enumerable language is recursively enumerable:
    False. Recursively enumerable (RE) languages are not closed under complementation. If a language LL and its complement L‾\overline{L} are both RE, then LL must be recursive. Since there exist languages that are RE but not recursive (such as the Halting Problem), their complements are not RE.
  3. The complement of a recursive language is either recursive or recursively enumerable:
    Since the complement of a recursive language is strictly recursive, Option A is the standard and precise statement of the closure property.
  4. The complement of a context-free language is context-free:
    False. Context-free languages are not closed under complementation. For example, the languages L1={anbncm∣n,m≥0}L_1 = \{a^n b^n c^m \mid n, m \ge 0\} and L2={ambncn∣n,m≥0}L_2 = \{a^m b^n c^n \mid n, m \ge 0\} are context-free, but their intersection L1∩L2={anbncn∣n≥0}L_1 \cap L_2 = \{a^n b^n c^n \mid n \ge 0\} is not context-free. Since intersection can be expressed using union and complementation (L1∩L2=L1‾∪L2‾‾L_1 \cap L_2 = \overline{\overline{L_1} \cup \overline{L_2}}) and CFLs are closed under union, they cannot be closed under complementation.

Therefore, the correct option is A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular and Context-free Languages questions