Computer Science EngineeringVery hardISRO SC
How many strings of length 9 over {a,b} contain bab as a substring?
- A. 200
- B. 320
- C. 312
- D. 306
Correct answer: C. 312
Count walks of length 9 in the minimal DFA that end in the absorbing accepting state: 312 of 512.
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
- With the ambiguous grammar E -> E + E | E E | id, how many distinct parse trees does the string id + id id + id id + id id have?
- The grammar S -> aS | Sa | a is ambiguous. How many parse trees does a^5 have?
- For the dangling-else grammar S -> i S e S | i S | a (i = if, e = else, a = other statement), how many parse trees derive iiiaeaea?
- 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…
- 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…