Skip to main content

GATE CSE 2021Theory of Computation › Language Classification, Closure Properties & ProofsVerified

GATE CSE 2021 PYQ: Let L 1 L_1 L 1 ​ be a regular language and L 2 L_2 L 2 ​ be a context-free language. Which of the following…

Let L1L_1 be a regular language and L2L_2 be a context-free language. Which of the following languages is/are context-free?

  1. A
    L1∩L2‾L_1 \cap \overline{L_2}
  2. B
    L1‾∪L2‾‾\overline{\overline{L_1} \cup \overline{L_2}}
    Correct answer
  3. C
    L1∪(L2∪L2‾)L_1 \cup (L_2 \cup \overline{L_2})
    Correct answer
  4. D
    (L1∩L2)∪(L1‾∩L2)(L_1 \cap L_2) \cup (\overline{L_1} \cap L_2)
    Correct answer

Answer

(B, C, D) L 1 ‾ ∪ L 2 ‾ ‾ \overline{\overline{L_1} \cup \overline{L_2}} L 1 ​ ​ ∪ L 2 ​ ​ ​; L 1 ∪ ( L 2 ∪ L 2 ‾ ) L_1 \cup (L_2 \cup \overline{L_2}) L 1 ​ ∪ ( L 2 ​ ∪ L 2 ​ ​ ); ( L 1 ∩ L 2 ) ∪ ( L 1 ‾ ∩ L 2 ) (L_1 \cap L_2) \cup (\overline{L_1} \cap L_2) ( L 1 ​ ∩ L 2 ​ ) ∪ ( L 1 ​ ​ ∩ L 2 ​ )

Approach

Simplify each set expression using De Morgan and standard closure properties: regular languages are closed under complement, union, and intersection; context-free languages are closed under union and under intersection with regular languages, but not under complement or arbitrary intersection. Then test whether each simplified form is guaranteed context-free.

Options B, C, and D reduce respectively to \(L_1 \cap L_2\), \(\Sigma^*\), and \(L_2\), all of which are guaranteed context-free under the given conditions. Option A does not always reduce to a context-free language because the complement of a context-free language is not necessarily context-free.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.