GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Which of the following statements are correct? I. The reversal of a deterministic context-free language is always deterministic context-free. II. Context-sensitive languages are closed under reversal. III. Recursive (decidable) languages are closed under reversal. IV. The reversal of a deterministic context-free language is always context-free.

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

Correct answer: A. II, III and IV only

I fails: { c aⁿbⁿ } ∪ { d aⁿb²ⁿ } is a DCFL (the first symbol decides), but its reversal { bⁿaⁿ c } ∪ { b²ⁿaⁿ d } would need to know the last symbol in advance — not a DCFL. II: reverse each rule of a CSG (or let an LBA read backwards). III: a decider can read its input backwards. IV: every DCFL is a CFL, and CFLs are closed under reversal.

More Theory of Computation questions

Exams that ask this topic