GATE Computer ScienceHardGATE CS (PYQ pattern)

How many binary strings of length 12 have the number of occurrences of 01 equal to the number of occurrences of 10?

  1. A. 1024
  2. B. 2112
  3. C. 2048
  4. D. 1792

Correct answer: C. 2048

The counts of 01 and 10 are equal exactly when the first and last symbols are equal, which holds for half of all strings: 2¹² / 2 = 2048.

More Theory of Computation questions

Exams that ask this topic