Computer Science EngineeringHard
A string of length 5 is derived in a grammar in Chomsky normal form. How many derivation steps are required?
- A. 9
- B. 10
- C. 5
- D. 11
Correct answer: A. 9
CNF needs 2n - 1 steps for a string of length n, so 2*5 - 1 = 9.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- Deterministic context-free languages are closed under
- Rice's theorem states that every non-trivial property of which of the following, for a Turing machine, is undecidable?
- For the grammar S -> AB, A -> a | epsilon, B -> b, what is FIRST(S)?
- How many LR(0) items does the production A -> XYZ generate?
- How many tokens are there in the C statement: int a = b + 2;
- A complete DFA has 6 states, of which 2 are accepting. The DFA for the complement language, obtained by swapping accepting and…