GATE Computer ScienceHardGATE CS (PYQ pattern)
Which of the following languages over {a, b, c} is NOT context-free?
- A. { aⁱbʲcᵏ : i < j or j < k }
- B. { aⁱbʲcᵏ : i < j < k }
- C. { aⁱbʲcᵏ : i ≠ j or j ≠ k }
- D. { aⁿbⁿcᵐ : n, m ≥ 0 }
Correct answer: B. { aⁱbʲcᵏ : i < j < k }
i < j < k needs two simultaneous comparisons on a single stack; the pumping lemma for CFLs refutes it. The 'or' versions are unions of two CFLs, and aⁿbⁿcᵐ needs only one comparison.
More Theory of Computation questions
- 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…
- Which of the following problems is decidable?
- Which of the following problems is undecidable?
- Let TOTAL = { ⟨M⟩ : the Turing machine M halts on every input }. Which statement about TOTAL is correct?