If given a single permutation, sgn() should return either +1 or -1, depending on the sign of the permutation. But, sometimes it returns more than one number:
> w <- word(rbind(c(3,4,1,2)))
> w
[1] (13)(24)
> sgn(word(rbind(c(3,4,1,2))))
[1] -1 -1
>
Here, permutation w is a product of two transpositions, each with a sign of -1 so I would expect a sign of (-1)*(-1)=+1. But, we get a sign of each transposition separately.
If given a single permutation,
sgn()
should return either +1 or -1, depending on the sign of the permutation. But, sometimes it returns more than one number:Here, permutation
w
is a product of two transpositions, each with a sign of -1 so I would expect a sign of (-1)*(-1)=+1. But, we get a sign of each transposition separately.