Counting inversions in lists algorithmically I want to extract useful info from some data and this makes me think how to do it efficiently.
I will try to explain the problem with math terms.
If we have a sequence of numbers $A=(a_{1}\space a_{2}\dots a_{n})$ and we want to count the number of inversions, ie the number of pairs $(a_{i},a_{j}), 1\leq i < j\leq n$ and $a_{i}>a_{j}$.
I want to find a good algorithm that will solve this problem.
I am looking for an algorithm that is better from the trivial one that solves the problem in polynomial time.

The reason you didn't find a solution to this by searching seems to be that the more usual term for what you call a "reversal" is "inversion". Searching for algorithms counting the number of inversions generates lots of hits, including these two questions on stackoverflow with lots of answers:
Counting inversions in an array and How to find the number of inversions in an array.
