Question: Generating all permutation of an array

Hi,

  Excuse me, I have the following code

  

###########################

with(combinat);
with(LinearAlgebra);
f:=([1,2,3]);
permute(f);

n:=3;
g:=array(1..n);

for i from 1 to n do
  g[i]:=i;
end do;

permute(g);

###########################

 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!

 

Please Wait...