Re: Permutations...

*To*: mathgroup at smc.vnet.net*Subject*: [mg95778] Re: Permutations...*From*: sashap <pavlyk at gmail.com>*Date*: Tue, 27 Jan 2009 06:57:35 -0500 (EST)*References*: <glk869$oc9$1@smc.vnet.net>

On Jan 26, 5:52 am, bruno... at libero.it wrote: > Given 4 elements (1 2 3 4) we have 6 translatios: > 1 2 3 4 > 1 3 2 4 > 1 4 2 3 > 2 1 3 4 > 3 1 2 4 > 4 3 2 1 Hi Bruno, The question you pose is to enumerate representatives of equivalence classes of a coset S_4/Z_4 where Z_4 is generated by cyclic shifts. It is obvious that you can always choose the first element of the representative to be 1. Hence once way to generate those 6 elements is through Join[{1}, #]& /@ Permutations[Range[2,4]] and it is clear that there 6 of them. Another way is to supply a custom test function to Union: In[61]:= Union[Permutations[Range[4]], SameTest -> Function[{p1, p2}, Module[{pos}, {{pos}} = Position[p2, First[p1], {1}, 1, Heads -> False]; p1 === Take[Join[p2, p2], {pos, pos + Length[p2] - 1}] ]]] Out[61]= {{1, 2, 3, 4}, {1, 2, 4, 3}, {1, 3, 2, 4}, {1, 3, 4, 2}, {1, 4, 2, 3}, {1, 4, 3, 2}} Hope this helps, Oleksandr Pavlyk > > Each translation can generate 4 rotations: > 1 2 3 4 1 3 2 4 1 4 2 3 > 2 3 4 1 3 2 4 1 4 2 3 1 > 3 4 1 2 4 1 3 2 3 1 4 2 > 4 1 2 3 4 1 3 2 3 1 4 2 > etc. > > Then: > Translations = (4-1)! = 6 > Rotations = 4 per translation > Permutations = Trans * Rot = 4! = 24 > > With Mathematica: > Permutations[Range[4]] prints all 24 Permutations > How can I get the 6 Translations and the 18 Rotations separately? > > Bruno