GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Which of the following statements about context-free languages are correct? I. The intersection of a CFL with a DCFL is always a CFL. II. The inverse homomorphic image h⁻¹(L) of a CFL L is a CFL. III. The right quotient L / R = { x : xy ∈ L for some y ∈ R } of a CFL L by a regular R is a CFL. IV. L − R is a CFL for every CFL L and regular R.

  1. A. II and IV only
  2. B. II, III and IV only
  3. C. I, II and IV only
  4. D. II and III only

Correct answer: B. II, III and IV only

I is false: { aⁿbⁿcᵐ } (a DCFL) ∩ { aᵐbⁿcⁿ } (a CFL) = { aⁿbⁿcⁿ }. II holds (simulate h on the PDA's input). III holds (CFLs are closed under quotient with any regular set). IV holds since L − R = L ∩ complement(R), a CFL ∩ regular.

More Theory of Computation questions

Exams that ask this topic