GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many words of length 8 over the alphabet {a, b, c} contain each of the letters a, b and c an even number of times (zero allowed)?

  1. A. 1641
  2. B. 1640
  3. C. 2190
  4. D. 1094

Correct answer: A. 1641

The exponential generating function is cosh³x, so the count is the average of the 8 sign patterns of (ε₁ + ε₂ + ε₃)⁸: (1/8)(3⁸ + 3·1⁸ + 3·(−1)⁸ + (−3)⁸) = (6561 + 3 + 3 + 6561)/8 = 1641.

More Discrete Mathematics questions

Exams that ask this topic