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.
- A. II, III and IV only
- B. I, II and III only
- C. III and IV only
- 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
- Which of the following statements are correct? I. Recursively enumerable languages are closed under union and intersection. II…
- L₁ and L₂ are context-free languages. Which statement about L₁ ∩ L₂ is always correct?
- The grammar S → aSb | SS | ab generates 14 strings of length 8. How many of these strings have MORE than one parse tree?
- How many strings of length 6 over {a, b} match the regular expression (a + ab)(b + ba)?
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {2,3}. Transitions: δ(0): a→{2}, b→{0,2,3}; δ(1): a→{0,1,2}…
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {1}. Transitions: δ(0): a→{0,1}, b→{1}; δ(1): a→{0,1,2,3}, b→∅…