Placement AptitudeVery hardGoldman Sachs OA · CAT

In how many permutations of 1, 2, 3, 4, 5 are there exactly 2 inversions? (An inversion is a pair of positions i < j with the larger number first.)

  1. A. 10
  2. B. 4
  3. C. 6
  4. D. 9

Correct answer: D. 9

Exactly 2 inversions come from either two separate adjacent swaps (2 non-overlapping pairs among the 4 adjacent positions: 3 ways, e.g. 21435) or one number jumping two places inside three consecutive positions (3 windows × 2 directions = 6, e.g. 31245 or 23145). Total 9.

More Permutations, Combinations and Probability (Placement) questions

Exams that ask this topic