GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many injective functions f : {1, 2, 3, 4} → {1, 2, …, 7} satisfy f(i) ≠ i for every i?

  1. A. 480
  2. B. 840
  3. C. 489
  4. D. 465

Correct answer: D. 465

Total injections 7·6·5·4 = 840. Inclusion-exclusion over the set of fixed positions: Σ(−1)ᵏ C(4,k)·P(7 − k, 4 − k) = 840 − 4·120 + 6·30 − 4·6 + 1 = 465.

More Discrete Mathematics questions

Exams that ask this topic