GATE Computer ScienceHardGATE CS (PYQ pattern)
How many binary strings of length 10 contain no two consecutive 1s and also do not have 1 at both the first and the last position?
- A. 144
- B. 136
- C. 123
- D. 128
Correct answer: C. 123
Strings without 11 number F(12) = 144; those starting and ending with 1 (so 0 at positions 2 and 9, free middle of length 6 with no 11) number 21. The answer is 123.
More Theory of Computation questions
- How many strings of length 9 over {a, b} satisfy (na − nb) ≡ 0 (mod 3) AND contain no bb as a substring?
- How many binary strings of length 10 contain 0110 as a substring?
- How many strings of length 7 over {a, b} belong to the language of the regular expression (a + ab + ba)?
- How many strings of length 10 over {a, b} lie in the language of the regular expression abab?
- The regular expression ((aa + bb)(ab + ba)) is over Σ = {a, b}. How many states does the minimal complete DFA for its language have?
- Exactly one of the following strings is NOT in the language of (a + ab)(b + ba). Which one?