GATE Computer ScienceHardGATE CS

Let f be a function from {1, 2, 3, 4, 5, 6} to {a, b, c, d}. How many onto (surjective) functions satisfy f(1) = a?

  1. A. 360
  2. B. 390
  3. C. 1560
  4. D. 420

Correct answer: B. 390

The total number of surjections is 4^6 − 4·3^6 + 6·2^6 − 4 = 1560. By symmetry each of the four codomain elements is equally likely to be the image of 1, so 1560 / 4 = 390.

More Discrete Mathematics questions

Exams that ask this topic