GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many binary strings of length 12 contain no two consecutive 1s and, read as a binary number (leading zeros allowed), are divisible by 3?

  1. A. 144
  2. B. 132
  3. C. 116
  4. D. 125

Correct answer: D. 125

Run the product of the mod-3 remainder tracker and the 'last symbol was 1' flag for 12 steps (2·3 = 6 live states): the accepted count is 125; 377 strings avoid 11, and only about a third are multiples of 3.

More Theory of Computation questions

Exams that ask this topic