GATE Computer ScienceHardGATE CS

How many strings of length 12 of the form aⁱbʲcᵏ (i, j, k ≥ 0, i + j + k = 12) satisfy i ≠ j and j ≠ k?

  1. A. 76
  2. B. 78
  3. C. 84
  4. D. 80

Correct answer: B. 78

All 91 strings of that form; remove the 7 with i = j and the 7 with j = k, and add back the 1 with i = j = k = 4 that was subtracted twice: 91 − 7 − 7 + 1 = 78.

More Theory of Computation questions

Exams that ask this topic