Mathematics (JEE)HardTCS NQT · Accenture

How many strings of length 5 over the alphabet {0, 1, 2, 3} have no two equal adjacent symbols and do not begin with 0?

  1. A. 324
  2. B. 243
  3. C. 81
  4. D. 768

Correct answer: B. 243

The first symbol has 3 choices (1, 2 or 3), and each of the next 4 symbols avoids only its left neighbour, so 3 choices each: 3 * 3^4 = 243.

More Permutations, Combinations and Probability questions

Exams that ask this topic