Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Return the inversion vector of the permutation.

The inversion vector consists of elements whose value
indicates the number of elements in the permutation
that are lesser than it and lie on its right hand side.

The inversion vector is the same as the Lehmer encoding of a
permutation.

Examples(more...)

src/s/y/sympy-0.7.5/sympy/combinatorics/tests/test_permutations.py   sympy(Download)
    assert q.atoms() == set([0, 1, 2, 3, 4, 5, 6])
 
    assert p.inversion_vector() == [2, 4, 1, 3, 1, 0]
    assert q.inversion_vector() == [3, 1, 2, 2, 0, 1]
 
    assert Permutation.from_inversion_vector(p.inversion_vector()) == p

src/s/y/sympy-HEAD/sympy/combinatorics/tests/test_permutations.py   sympy(Download)
    assert q.atoms() == set([0, 1, 2, 3, 4, 5, 6])
 
    assert p.inversion_vector() == [2, 4, 1, 3, 1, 0]
    assert q.inversion_vector() == [3, 1, 2, 2, 0, 1]
 
    assert Permutation.from_inversion_vector(p.inversion_vector()) == p