Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Permutations...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95793] Re: Permutations...
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Tue, 27 Jan 2009 07:00:28 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <glk869$oc9$1@smc.vnet.net>

In article <glk869$oc9$1 at smc.vnet.net>, brunocam 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
> 
> 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

You can get the translations by applying repeatedly *RotateLeft*. For 
instance,

In[1]:= Table[RotateLeft[{1, 2, 3, 4}, n], {n, 0, 3}]

Out[1]= {{1, 2, 3, 4}, {2, 3, 4, 1}, {3, 4, 1, 2}, {4, 1, 2, 3}}

In[2]:= Table[RotateLeft[#, n], {n, 0, 3}] & /@ {{1, 2, 3, 4}, {1, 3,    
2, 4}}

Out[2]= 
{{{1, 2, 3, 4}, {2, 3, 4, 1}, {3, 4, 1, 2}, {4, 1, 2, 3}},
 {{1, 3, 2, 4}, {3, 2, 4, 1}, {2, 4, 1, 3}, {4, 1, 3, 2}}}


  • Prev by Date: Re: Additive inverses of lists?
  • Next by Date: Re: Non-deterministic numerical inaccuracies in
  • Previous by thread: Re: Permutations...
  • Next by thread: Re: Permutations...