ProgrammingHardGATE CS · Campus placements

How many permutations of 4 distinct items have no item in its original position?

  1. A. 6
  2. B. 8
  3. C. 9
  4. D. 12

Correct answer: C. 9

By inclusion-exclusion, D(4) = 24 - 4*6 + 6*2 - 4*1 + 1 = 9. These are the derangements, and the count is the same for any labelling of the items.

More C Programming questions

Exams that ask this topic