GATE Computer ScienceHardGATE CSE · ISRO

How many strings of length at most 5 over {0, 1} (the empty string included) contain the substring 00 and also have an even number of 1s?

  1. A. 19
  2. B. 16
  3. C. 12
  4. D. 24

Correct answer: B. 16

Enumerating lengths 0 to 5 and testing both conditions gives 16 strings.

More Theory of Computation questions

Exams that ask this topic