3

In the second chapter of Cormen's textbook on Algorithms, he lists a discrete mathematics exercise on so-called "inversions", defined as follows:

Let $A[1 \ldots n]$ be an array of $n$ distinct numbers. If $i < j$ and $A[i] > A[j]$, then the pair $(i, j)$ is called an inversion of $A$.

Question: Is this a mathematical concept that is used frequently in computer science? Are there some widely known applications of inversions that other people here know of? (I checked the wikipedia page for the concept, but it didn't list any).

PP121
  • 53
  • 6
  • To answer your question: it comes up here and there, but not very often. One example is the definition of the Mallows distribution. – Yuval Filmus Aug 28 '15 at 15:04

1 Answers1

4

To analyse many algorithms, in particular for the all-important sorting problem, the characteristics of permutations are important measures. For instance, the number of inversions determines the number of data movements when running insertion sort.

vonbrand
  • 14,004
  • 3
  • 40
  • 50