GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 2.8

Closure properties of context-free languages

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

GATE 1996, Q2.8 2 marks · MCQ
Report issue

Closure Properties & Language Hierarchy

Question 2.8, GATE 1996: For CFLs L1,L2 and regular R, which need not be context-free: concatenation, L1∩L2, L1∩R, or union?
Tap to enlarge
Your answer
Answer & solution

Answer: B, C (no official key was published)

Context-free languages are closed under union and concatenation by introducing an appropriate new grammar start rule. They are also closed under intersection with a regular language, using a product of a PDA and a finite automaton. But take L1={an bn cm} and L2={am bn cn}, with nonnegative exponents. Each is context-free, while their intersection is {an bn cn}, which is not. Hence intersection of two arbitrary CFLs is the exceptional operation. The paper instead repeats L1∩L2 in choice C, making both B and C valid answers to its literal options; this source discrepancy is retained.

Original paper, page 4