GATE Computer ScienceHardGATE CS (PYQ pattern)
L₁ is context-free, L₂ is regular and L₃ is deterministic context-free (all over the same alphabet Σ, complements taken w.r.t. Σ*). Which of the following is NOT necessarily context-free?
- A. (L₁ ∪ L₃) − L₂
- B. (complement of L₃) ∩ L₂
- C. (complement of L₁) ∪ L₂
- D. L₁ · (L₃)*
Correct answer: C. (complement of L₁) ∪ L₂
(L₁ ∪ L₃) − L₂ = (CFL) ∩ (complement of L₂, regular): CFL. Complement of a DCFL is a DCFL, and ∩ regular stays DCFL. CFLs are closed under concatenation and star. But (complement of L₁) ∪ L₂ = complement of (L₁ ∩ complement L₂), the complement of an arbitrary CFL, which need not be context-free (take L₂ = ∅).
More Theory of Computation questions
- Which of the following statements about deterministic context-free languages (DCFLs) are correct? I. The complement of a DCFL is a DCFL…
- 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…
- Which of the following languages over {a, b, c} is NOT context-free?
- Which one of the following languages is regular?
- To show that L = { aⁱbʲ : i > j } is not regular by the pumping lemma with pumping length p, which string and pumping choice give a valid…
- Consider these problems about a Turing machine M (given as input): I. Does M ever move its head to the left when started on the blank…