Permutation tests related to the inversion