GATE Computer ScienceVery hardGATE CSE · UGC NET

Among the six languages L₁ = {aⁱbʲcᵏdˡ : i = k and j = l}, L₂ = {aⁱbʲcᵏ : i = j or j = k}, L₃ = {wwᴿ : w ∈ {a,b}*}, L₄ = complement of {aⁿbⁿcⁿ : n ≥ 0} over {a,b,c}, L₅ = {aⁱbʲ : i ≠ j}, L₆ = {ww : w ∈ {a,b}*}, how many are context-free?

  1. A. 3
  2. B. 5
  3. C. 4
  4. D. 2

Correct answer: C. 4

L₂ (union of two CFLs), L₃, L₄ (a nondeterministic PDA guesses an ordering violation or a count mismatch) and L₅ are context-free; L₁ (crossing dependencies) and L₆ are not.

More Theory of Computation questions

Exams that ask this topic