Items tagged with permutation permutation Tagged Items Feed

How would you apply a permutation to a list?


So, with permutation [[1,3],[2,4]], given in disjoint cycles,

how would you apply it to [1,2,3,4] to obtain [3,4,1,2]?





  Excuse me, I have the following code





for i from 1 to n do
end do;



 The output ends up with


Error, (in combinat:-permute) 1st argument must be a list, set or a non-negative integer


 It seems that maple will not generate permutation of g... How to generate the permutation of array g? i.e. by assigning all variables automatically.


Thank you very much!


Hi there, this is my first post in this forum. I hope you can help me with my problem :)

I've created a little program to solve a problem for my class. This is the first time, I wrote a program with Maple, so please don't laugh. 

I've posted the Maple code below:


restart; randomize():
with(plots): with(plottools): with(LinearAlgebra): with(Statistics): with(MTM):

s:={1=2, 3=2}:



local m, h, adresses, rndmAdrs, omega: omega:=Vector[row](np,s);


for m from 1 to np do
if(omega[m]=0) then
end if


for m from 1 to volfrac*np do

for m from 1 to np -(volfrac*np+nops(s)) do





local m, alle:

alle:=Matrix(nr,np); for m from 1 to nr do


alle[m]:=Realisierung(np,volfrac); od;





I used the Shuffle function from Statistics-package to randomly permutate the components in the Vector adresses. Which works fine. By setting Randomize(); I get randomly results vor this permutation, when I execute the whole worksheet.

But when the "Realisierung" procedure is called in the for loop of the "RealMatrix" procedure, always the same Permutation is calculated.

This leads to the fact, that every row in my matrix looks the same.
Like in the example

2 1 2 2 1
2 1 2 2 1
2 1 2 2 1
2 1 2 2 1
2 1 2 2 1

but the lines should be randmly like

2 1 2 2 1
2 2 2 1 1
2 1 2 1 2
2 1 2 2 1


Obvioulsy the problem is in the randomize()-command. I tried to place it directly after "restart" and directly before the Shuffling is executed.
But I had no succes. 

Maybe one of you can help me?
Would be great!







Hi all

Can anybody suggest an algorithm allowing to detect, that two matrices of the same size can be obtained each from other by permutations of rows and columns? Maybe, such an algorithm there exists in LinearAlgebra package?

How can I get the Automorphism Group of a group G as a Permutationgroup?


Best regards


Kurt Ewald


I would like to compute the elements of the permutation group, let us say S10 or S20.

Is there any method to compute all the elements.

And can we make a list of the tranposition and cycles.

Many thinks.


for example

a*b v a^-1 = b

i guess Disj or Conj are Max or Min respectively

however i do not know how to max(a,b) where a and b are permutation group

reference from L group in


if can not calculate this, do not know how to determine whether equal in a*b v a^-1 = b

a*b - b*a    where a , b are permutation group

how to minus this?

if a + b , then how to plus permutation group

Greetings to all.

It is a new year (for some time now) and I am writing to indicate that the mathematical adventures with cycle index computations and Maple continue!

Here are the previous installments:

My purpose this time is to alert readers who might be interested to a new cycle index computation that is neither an application of the classical form of the Polya Enumeration Theorem (PET) nor of Power Group Enumeration. The former counts objects being distributed into slots with a group acting on the slots and the latter objects going into slots with a second group which permutes the objects in addition to the slots being permuted. What I am about to present treats a third possible case: when the slot permutation group and the object permutation group are one and the same and act simultaneously (not exactly the same but induced by the action of a single group).

This requires quite radical proceedings in the etymological sense of the word, which is to go back to the roots of a problem. It seems that after working with the PET sooner or later one is confronted with enumeration problems that demand the original unmitigated power of Burnside's lemma, sometimes called the lemma that is not Burnside's. This is the case with the following problem. Suppose you have an N-by-N matrix whose entries are values from 1 to N, with all assignments allowed and the symmetric group on N elements acts on the row and column indices permuting rows and columns as well as the entries simultaneously. We ask how many such matrices there are taking these double symmetries into account. This also counts the number of closed binary operations on a set of N elemnents and there is a discussion as well as the Maple code (quite simple in my opinion and no more than a few lines) that solves this problem at the following Math Stackexchange link, which uses Lovasz Formula for the cycle index of the symmetric group which some readers may remember.

In continuing the saga of Polya and Burnside exploration I have often reflected on how best to encapsulate these techniques in a Maple package. With this latest installment it would appear that a command to do Burnside enumeration probably ought to be part of such a package.

Best regards,

Marko Riedel

Greetings to all.

This past year I have on occasion shared mathematical adventures with cycle index computations and Maple, e.g. at these links:

Befitting the season I am sending another post to continue this series of cycle index computations. I present two Maple implementations of Power Group Enumeration as described by Harary and Palmer in their book "Graphical Enumeration" and by Fripertinger in his paper "Enumeration in Musical Theory." It was a real joy working with Maple to implement the computational aspects of their work, i.e. the Power Group Enumeration Theorem. Moreover the resulting software is easy to read, simple and powerful and has a straightforward interface, taking advantage of many different capabilities present in Maple.

The problem I am treating is readily described. Consider a cube in 3 space and its symmetries under rotation, i.e. rigid motions. We ask in how many different ways we may color the edges of the cube with at most N colors where all colors are completely interchangable, i.e. have the symmetric group acting on them in addition to the edge permutation group of the cube. At the following Math Stackexchange Link  I have posted the Maple code to implement the algorithms / formulas of Harary / Palmer / Fripertinger to solve this problem. The reader is invited to study and test these algorithms. It seems to me an excellent instance of computational combinatorics fun.

To conclude I would like to point out that these algorithms might be candidates for a Polya Enumeration Theorem (PET) package that I have been suggesting for a future Maple release at the above posts, the algorithms being of remarkable simplicity while at the same time providing surprisingly sophisticated combinatorics and enumeration methods.

Season's greetings!

Marko Riedel

list1 := permute([a, b, a, b, a, b], 3);
list1a := subs(b=1,subs(a=0, list1));
list1a := permute([seq(seq(k,k=0..1),k2=1..3)], 3);
list2 := permute([a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h], 3);
list3 := subs(h=18,subs(g=17,subs(f=16,subs(e=15,subs(d=14,subs(c=13,subs(b=12,subs(a=11,list2))))))));
list3 := permute([seq(seq(k,k=11..18),k2=1..3)], 3);
list5 := Matrix(nops(list1a)*nops(list3), 1);
count := 1;
for n from 1 to nops(list3) do
temp1 := subs(1=list1a[1],list3[n]);
for k from 11 to nops(list1a)+10 do
temp1 := subs(k=list1a[k-10],temp1);
list5[count] := temp1;
count := count + 1;
list6 := permute(list5, 2);

Error, (in combinat:-permute) 1st argument must be a list, set or a non-negative integer

Just a simple question.

If you have 10 objects and you choose 6 and order doesn't matter,




                         /  n    \

if given a permutation group

1 2 3

2 1 3

How to calculate the cycle factorization and type of permutation group f in polya counting in maple

Dear friends,

this is to share with you what a joy it was to work with Maple on the problem of enumerating non-isomorphic graphs. This problem goes back to Polya and Harary and it is a beautiful example of Polya counting, while also being of notable simplicity, so that a high school student or an undergraduate can follow it easily.

I have worked on this problem over the years, adapting my solutions in Cocoa and Lisp as I gained insights. My first attempt used...

Dear friends, I recently answered a query concerning the action of the automorphism group of the Petersen graph on its edges at The algorithm that I present is quite naive, but it does produce the desired result. I thought I would share it here because it makes a nice Maple programming exercise e.g. for a talented student at high school level. ...

1 2 Page 1 of 2