GATE / CS ARCHIVE

GATE CSE 2023 / QUESTION 24

GATE CSE 2023 Q24

Theory of Computation · Closure Properties & Language Hierarchy · Full GATE CSE 2023 paper

GATE 2023, Q24 1 mark · MSQ
Report issue

Closure Properties & Language Hierarchy

Question 24, GATE 2023: Which language classes are closed under intersection with another language in the same class? A regular; B context-free; C recursive (decidable); D recursively enumerable (recognizable). Select all.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, C, D

Regular intersection uses a product automaton. Decidable-language intersection runs both halting deciders and accepts iff both accept. For recursively enumerable languages, dovetail the recognizers and accept once both have accepted, giving a recognizer. CFL intersection is not closed: {aⁿbⁿcᵐ}∩{aᵐbⁿcⁿ}={aⁿbⁿcⁿ}, which is not context-free. Thus A, C, D.

Teaching detail. For regular languages, a product DFA tracks both component states and accepts only when both components accept. For decidable languages, running the two deciders sequentially terminates, whether the answer is yes or no. For recognizers, a rejecting computation might never terminate, so dovetailing makes explicit that an accepting computation in each recognizer will eventually be observed. The CFL counterexample uses one language checking equality of a's and b's and another checking equality of b's and c's; requiring both produces the standard non-CFL of three equal counts.

Original paper, page 22 · Answer key