Petrea Corneliu Ştefan >
CM-Permutation-0.94 >
CM::Permutation

Module Version: 0.94
Permutations can be viewed as braids but braids are much more general. (if you consider a permutation and apply it to itself it returns to the identical permutation, if you have a braid that's a transposition and apply it to itself you get a double-twist, one more time you get a triple twist and so forth this continues indefinitely).

CM::Permutation - Module for manipulating permutations

version 0.94

The module was written for carrying out permutation operations. This module treats permutations as bijections on finite sets. The module is not written for generating permutations or counting them(to that end you can use Algorithm::Permute or Math::Counting)

At the moment the following are implemented(any feature that is currently listed as implemented has tests proving it):

- permutation composition and conjugate permutations
- inverse of a permutation
- "power" of a permutation
- '==' operator implemented (eq is the same)
- order() method
- even_odd(x) to classify even and odd permutations
- conjugate(x,y) which test if there is a g so that x = g y g^-1
- get_cycles() decomposes permutation into cycles and returns them

There's also a draw() method so if you want to visualize permutations as braids you can.

For example permutation (9,6,4,8,5,3,7,10,1,2) can be representated as a braid like this:

and permutation (6,10,2,9,6,1,7,8,4,5) is like this

Then you can also compute a*b

And also a*b*a^-1

And also [a,b] which is a*b*a^-1*b^-1

Cycles have the following shape (except they can have some fixed points inside them)

[1,2,3,4,5]

or like this

However, braids are more general than permutations. The twists that are the analog of transpositions(in symmetric groups) for braids have infinite order since you can twist 2 strands as many times you want. Another difference is that for a transposition x we have x = x^-1, but with braids that isn't true since you have the first strand above the second for x and for x^-1 you have the second over the first so you can un-twist the braid using x^-1.

To understand better how transpositions and cycles interact let's take a look at the following diagram which shows the effects of multiplying a permutation formed of two cycles with a transposition containing members from each of the cycles:

Let's have an example of this with the cycles [1,2,3,4] , [5,6,7,8] and the transposition [3,7] :

./shell.sh $ decomp(cycle(1,2,3,4)*cycle(5,6,7,8)) (2,3,4,1)*(6,7,8,5) $ decomp(cycle(1,2,3,4)*cycle(5,6,7,8)*cycle(3,7)) (2,3,8,5,6,7,4,1)

Thanks for the colour ramp routine goes to BrowserUk @perlmonks

Stefan Petrea, `<stefan.petrea at gmail.com>`

Algorithm::Permute or Math::Counting

syntax highlighting: