Explicit formula for calculating number of transpositions

77 Views Asked by At

If we have a permutation of the first N natural numbers, is there an explicit formula that can tell you if the permutation is even or odd. For example, $(2,3,1)$ is even as it requires minimum of 2 changes and $(1,3,2)$ is odd. Suppose, you denote the value at index $i$ by $k_i$. Is there a function $f(i,k_i)$ which will the give the answer as, say +1 for even and -1 for odd?

1

There are 1 best solutions below

2
On

you can build a $k \times k$ matrix ($k = 3$ in your case) filled with zeroes, but put 1's at locations $2,3$ and $3,1$ and $1, 2$. Then take the determinant, and its sign will tell you whether the permutation is even or odd. And since the determinant is a polynomial, you're done. (You'll have to work out what to do with a permutation that's a PRODUCT of cycles, but I'm sure you can do so.)

Of course, this is hideously inefficient, but it will work...