Qm

How many pairs land out of order in a random ranking?

Six items have a true best-to-worst order. A reviewer, knowing nothing, ranks them in a completely random order. An "inversion" is any pair of items that the reviewer places in the opposite order to the truth.

On average, how many inversions does the random ranking contain?

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

How many rising steps in a shuffled list?How many falling steps in a shuffled list?Coats handed back at random: how many match?Secret Santa draws: how many pick themselves?Quizzes returned at random: how many honor students?Two judges: how many pairs do they order the same way?
All questions →