# Inversion (discrete mathematics)

 Array of 2-subsets of an 8-set (compare array ) The inversion vector shows the row sums of the inversion set.

An inversion is a pair of places of a permutation where the elements are out of their natural order.

The unique inversion set of a permutation is the set off all its inversions.
Its potential elements are all pairs of places, which can be arranged as a triangle.

The inversion vector shows the row sums of this triangle, usually with a leading zero.
It is a reflected factorial number, so it corresponds to an integer and is also unique.

The inversion number ( ) is the cardinality of the inversion set and the digit sum of the inversion vector.

## Arrays of permutations

 Odd evening, parted Odd evening, alternating Chains of transpositions Rows of transpositions Transpositions                (m,n) here corresponds to (n,m) in the array of 2-subsets. Nested transpositions Circular shift to the right Circular shift to the left

### Code

These are two MATLAB scripts used to calculate the b-files (like this one for , created with the first script).
All other scripts were small modifications of these.
They use the function mat2seq_sym. The text file Bfile.txt had to be edited with find and replace.

## Walsh permutations

 wp( 3, 5, 9, 1) wp( 4, 8, 1, 2) wp(14,13,11, 7)