Learn R Programming

polyMatrix (version 0.3.1)

permSign: The sign of the permutation

Description

The sign of a permutation equals to the parity of the count of involutions to order the given permutation

Usage

permSign(prm)

Arguments

prm

The permutation to evaluate

Value

The parity of the given permutation. Equals to +1 if even and -1 if it is odd.

See Also

permNext, ssetNext

Examples

Run this code
# NOT RUN {
permSign(c(1,2,3,4))
permSign(c(1,2,4,3))
permSign(c(2,1,4,3))
permSign(c(2,4,1,3))
# }

Run the code above in your browser using DataLab