Skip to main content

GATE CSE 2026Theory of Computation › Context-Free Languages & Pushdown AutomataVerified

GATE CSE 2026 PYQ: Let Σ = { a , b , c , d } \Sigma=\{a, b, c, d\} Σ = { a , b , c , d } and let L = { a i b j c k d ℓ ∣ i , j…

Let Σ={a,b,c,d}\Sigma=\{a, b, c, d\} and let L={aibjckdℓ∣i,j,k,ℓ≥0}L=\left\{a^{i} b^{j} c^{k} d^{\ell} \mid i, j, k, \ell \geq 0\right\}.

Which of the following constraints ensure(s) that the language LL is context-free?

  1. A
    i+k=j+ℓi+k=j+\ell
    Correct answer
  2. B
    i=ki=k and j=ℓj=\ell
  3. C
    i=ℓi=\ell and j=kj=k
    Correct answer
  4. D
    i+j=k+ℓi+j=k+\ell
    Correct answer

Answer

(A, C, D) i + k = j + ℓ i+k=j+\ell i + k = j + ℓ; i = ℓ i=\ell i = ℓ and j = k j=k j = k; i + j = k + ℓ i+j=k+\ell i + j = k + ℓ

Approach

Check each constraint for context-freeness by attempting to construct a PDA or using the pumping lemma for non-context-free cases.

Constraints A, C, and D can be enforced by a single stack (one-counter), making the language context-free. Constraint B requires matching two independent pairs in a cross-serial order, which is not context-free.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.