Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

conjugate

Are two permutations conjugate?


Description

Returns TRUE if two permutations are conjugate and FALSE otherwise.

Usage

are_conjugate(x, y)
are_conjugate_single(a,b)

Arguments

x,y,a,b

Objects of class permutation, coerced to cycle form

Details

Two permutations are conjugate if and only if they have the same shape. Function are_conjugate() is vectorized and user-friendly; function are_conjugate_single() is lower-level and operates only on length-one permutations.

The reason that are_conjugate_single() is a separate function and not bundled inside are_conjugate() is that dealing with the identity permutation is a pain in the arse.

Value

Returns a vector of Booleans

Note

The functionality detects conjugateness by comparing the shapes of two permutations; permutations are coerced to cycle form because function shape() does.

Author(s)

Robin K. S. Hankin

See Also

Examples

are_conjugate(rperm(20,3),rperm(20,3))

rperm(20,3) %~% cycle(1:3)

z <- rperm(300,4)
stopifnot(all(are_conjugate(z,id)==is.id(z)))

data(megaminx)
stopifnot(all(are_conjugate(megaminx,megaminx^as.cycle(sample(129)))))

permutations

The Symmetric Group: Permutations of a Finite Set

v1.0-9
GPL-2
Authors
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>), Paul Egeler [ctb] (<https://orcid.org/0000-0001-6948-9498>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.