GATE Computer ScienceHardGATE CS (PYQ pattern)
L₁ and L₂ are context-free languages. Which statement about L₁ ∩ L₂ is always correct?
- A. It is context-sensitive, hence decidable
- B. It is always context-free as well
- C. It is always a regular language
- D. It may be an undecidable language
Correct answer: A. It is context-sensitive, hence decidable
CFL ∩ CFL need not be context-free (e.g. {aⁿbⁿcᵐ} ∩ {aᵐbⁿcⁿ}) but it is always context-sensitive because CSLs contain CFLs and are closed under intersection; all CSLs are decidable.
More Theory of Computation questions
- 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→∅…
- An ε-NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {0,3}. Transitions: δ(0): a→{1,2}, b→{3}, ε→∅; δ(1): a→{2}…
- How many states does the minimal complete DFA have for the set of strings over {a, b} that begin with ab OR end with ab?