Computer Science EngineeringVery hardISRO SC
The CYK algorithm runs on a string of length 10 with a grammar in Chomsky normal form. Counting each (cell, split point) pair as one step, the total number of splits examined over all cells of spans longer than 1 is
- A. 55
- B. 166.66666666666666
- C. 175
- D. 165
Correct answer: D. 165
Sum over lengths l=2..n of (n-l+1)(l-1) = (n^3 - n)/6 = 165.
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
- A grammar in Chomsky normal form derives a string of length 9. The number of derivation steps (rule applications) in any derivation is
- 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…