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?
- A. 3
- B. 5
- C. 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
- A DFA reads a binary string least-significant bit first (so the first symbol read is the 2⁰ bit) and must accept exactly the strings whose…
- How many strings of length at most 6 (the empty string included) over {a, b} belong to L(aba)?
- An ε-NFA over {a, b} has states 0–4, start 0, accepting state 4. Moves: 0 –ε→ 1; 0 –a→ {0,1}; 1 –b→ 2; 2 –ε→ 3; 3 –a→ {3,4}; 4 –b→ 2. How…
- A Mealy machine starts in S0. Transitions (state, input → next state / output): (S0,0 → S0/0), (S0,1 → S1/1), (S1,0 → S2/1), (S1,1 →…
- How many strings of length at most 5 over {0, 1} (the empty string included) contain the substring 00 and also have an even number of 1s?
- A grammar in Chomsky normal form generates a string of length 17. How many derivation steps (production applications) does any derivation…