Computer Science EngineeringHardISRO SC
A grammar in Chomsky normal form derives a string of length 9. The number of derivation steps (rule applications) in any derivation is
- A. 9
- B. 17
- C. 18
- D. 16
Correct answer: B. 17
A CNF parse tree has 8 binary rules and 9 terminal rules: 2n-1 = 17.
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
- Consider the grammar E -> E+T | T; T -> TF | F; F -> (E) | id. The canonical LR(0) collection (with the augmented production S' -> start…
- For the grammar E -> E+T | T; T -> TF | F; F -> (E) | id, how many total LR(0) items (all dotted positions over all productions, excluding…
- Consider the grammar S -> AB; A -> aA | a; B -> bB | b. The canonical LR(0) collection (with the augmented production S' -> start symbol)…
- Consider the grammar S -> aAd | bBd | aBe | bAe; A -> c; B -> c. The canonical LR(0) collection (with the augmented production S' -> start…
- Consider the grammar E -> E+E | EE | id. In its LR(0) automaton (augmented grammar), how many states contain a shift/reduce or…
- Consider the grammar S -> iSeS | iS | a. In its LR(0) automaton (augmented grammar), how many states contain a shift/reduce or…