Mathematics (JEE)HardCodeforces Div2 C

How many permutations p of {1, 2, 3, 4, 5} satisfy p(i) not in {i, i+1} for every i from 1 to 4, and also p(5) is not 5?

  1. A. 16
  2. B. 19
  3. C. 44
  4. D. 32

Correct answer: A. 16

Enumerating all 120 permutations and rejecting any with p(i) equal to i or i+1 for i = 1..4, or with p(5) = 5, leaves 16 valid permutations.

More Permutations, Combinations and Probability questions

Exams that ask this topic