GATE Computer ScienceModerateGATE CS (PYQ pattern)
A grammar in Greibach normal form generates a string of length 15. How many derivation steps does any derivation of it take?
- A. 29
- B. 15
- C. 14
- D. 16
Correct answer: B. 15
Every GNF production starts with a terminal, so each step produces exactly one terminal symbol: n = 15 steps.
More Theory of Computation questions
- A grammar has only rules of the forms A → BC, A → BCD (three variables) and A → a. A parse tree of a string of length 9 uses exactly two…
- Which of the following computational models is strictly LESS powerful than a standard single-tape deterministic Turing machine?
- Which of the following problems for a linear bounded automaton (LBA) M and a string w is decidable?
- Let L = { aⁿbⁿ : 0 ≤ n ≤ 3 } over {a, b}. How many Myhill–Nerode equivalence classes does L have (equivalently, how many states does its…
- Which of the following languages is inherently ambiguous?
- Which of the following languages cannot be accepted by any deterministic pushdown automaton?