Mathematica has a built in function to generate all permutations of a given list of elements; Permutations
I can't find an equivalent function to generate cyclic permutations only in the documentation. Here is my function that achieves this goal:
CyclicPermutations[list_] :=
RotateRight[list, #] & /@ (Range[Length[list]] - 1)
Is there an in-built function somewhere that I've not been able to find?
And then a similar question which I don't have my own answer to. I would like to also generate all noncyclic permutations, ie. the set of permutations minus the set of cyclic permutations. I'm not sure of a good way to do this, I can think up some methods which use Permutations
and my CyclicPermutations
and then maybe DeleteCases
, but I think this will be comparatively very inefficient. Does anyone else have a better method?
Permute[#, CyclicGroup[Length@#]] &
$\endgroup$Complement[]
? $\endgroup$Permute
can work with a group. $\endgroup$