Given a string of digits "a_1 a_2 ... a_n", computes the inversion number of that string (the number of i<j such that a_i>a_j).
The object inversion is a method function with options.