Skip to content
Official PYQ · 2023

GATE CS 2023 Q14 — Regular and Context-free Languages

Explain with AI

Which of the following statements is/are CORRECT?\text{CORRECT}?

Select all correct options
View worked solution

Answer: A;C;D

We analyze the closure properties of the given language families under intersection:

  • Option A (Correct): Regular languages are closed under intersection. If L1L_1 and L2L_2 are regular, we can construct a product DFA to accept L1∩L2L_1 \cap L_2.
  • Option B (Incorrect): Context-free languages (CFLs) are not closed under intersection. For example, 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 both CFLs, 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.
  • Option C (Correct): Recursive (decidable) languages are closed under intersection. Given deciders M1M_1 and M2M_2 for two recursive languages, we can construct a decider MM that runs M1M_1 on the input, and if it accepts, runs M2M_2. MM halts and accepts if and only if both accept.
  • Option D (Correct): Recursively enumerable (RE) languages are closed under intersection. Given Turing machines M1M_1 and M2M_2 for two RE languages, we can construct a TM MM that runs M1M_1 and M2M_2 in parallel (using interleaving/step-by-step simulation). If both halt and accept, MM accepts.

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

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