GATE Computer ScienceVery hardGATE CS
Which of the following languages can be accepted by a deterministic pushdown automaton by EMPTY STACK (the stack is empty at the end of the input; no final states)? I. { aⁿbⁿ : n ≥ 0 } II. { aⁿbⁿ : n ≥ 1 } III. a* IV. { w c wᴿ : w ∈ {a, b}* }
- A. IV only
- B. II and IV only
- C. II, III and IV only
- D. I and II only
Correct answer: B. II and IV only
A language accepted by a DPDA by empty stack must be prefix-free: once the stack is empty the machine has halted. I contains ε, which is a prefix of every other member; III has a, aa, aaa, ... as prefixes of each other. II and IV are prefix-free deterministic languages.
More Theory of Computation questions
- How many strings of length 12 of the form aⁱbʲcᵏ (i, j, k ≥ 0, i + j + k = 12) satisfy i ≠ j and j ≠ k?
- Let L be the set of binary strings that, read as unsigned numbers MSB first (ε counts as 0 and is accepted), are divisible by 56. How many…
- Let L = { w ∈ {a, b} : |w| ≡ 0 (mod 3) and w contains ab as a substring }. How many states does the minimal complete DFA for L have?
- Over {a, b}, let L = { w : the number of a's in w is ≡ 1 (mod 3) and w ends with b }. How many states does the minimal complete DFA for L…
- How many strings of length 7 over {a, b} do not contain aa as a substring?
- Binary numerals are read most significant bit first (leading zeros allowed, the empty string counts as 0). What is the number of states in…