permorder {permutations} | R Documentation |
The order of a permutation
Description
Returns the order of a permutation P
: the smallest strictly
positive integer n
for which P^n
is the identity.
Usage
permorder(x, singly = TRUE)
Arguments
x |
Permutation, coerced to |
singly |
Boolean, with default |
Details
Coerces its argument to cycle form.
The order of the identity permutation is 1.
Note
Uses mLCM()
from the numbers
package.
Author(s)
Robin K. S. Hankin
See Also
Examples
x <- rperm(5,20)
permorder(x)
permorder(x,FALSE)
stopifnot(all(is.id(x^permorder(x))))
stopifnot(is.id(x^permorder(x,FALSE)))
[Package permutations version 1.1-5 Index]