Re: S_4 elements
- To: mathgroup at smc.vnet.net
- Subject: [mg48435] Re: S_4 elements
- From: "Dr. Wolfgang Hintze" <weh at snafu.de>
- Date: Sat, 29 May 2004 03:06:58 -0400 (EDT)
- References: <c96hpf$ii5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jorge, first load the appropriate package In[29]:= << "DiscreteMath`Combinatorica`" then you get all 4!=24 permutations using the function Permutation of the package In[30]:= x = {1, 2, 3, 4} y = Permutations[x] Out[30]= {1, 2, 3, 4} Out[31]= {{1, 2, 3, 4}, {1, 2, 4, 3}, {1, 3, 2, 4}, {1, 3, 4, 2}, {1, 4, 2, 3}, {1, 4, 3, 2}, {2, 1, 3, 4}, {2, 1, 4, 3}, {2, 3, 1, 4}, {2, 3, 4, 1}, {2, 4, 1, 3}, {2, 4, 3, 1}, {3, 1, 2, 4}, {3, 1, 4, 2}, {3, 2, 1, 4}, {3, 2, 4, 1}, {3, 4, 1, 2}, {3, 4, 2, 1}, {4, 1, 2, 3}, {4, 1, 3, 2}, {4, 2, 1, 3}, {4, 2, 3, 1}, {4, 3, 1, 2}, {4, 3, 2, 1}} The cycle structure of the permutations can be obtained using the function ToCycles contained in the package, ie. In[45]:= ToCycles /@ y Out[45]= {{{1}, {2}, {3}, {4}}, {{1}, {2}, {4, 3}}, {{1}, {3, 2}, {4}}, {{1}, {3, 4, 2}}, {{1}, {4, 3, 2}}, {{1}, {4, 2}, {3}}, {{2, 1}, {3}, {4}}, {{2, 1}, {4, 3}}, {{2, 3, 1}, {4}}, {{2, 3, 4, 1}}, {{2, 4, 3, 1}}, {{2, 4, 1}, {3}}, {{3, 2, 1}, {4}}, {{3, 4, 2, 1}}, {{3, 1}, {2}, {4}}, {{3, 4, 1}, {2}}, {{3, 1}, {4, 2}}, {{3, 2, 4, 1}}, {{4, 3, 2, 1}}, {{4, 2, 1}, {3}}, {{4, 3, 1}, {2}}, {{4, 1}, {2}, {3}}, {{4, 2, 3, 1}}, {{4, 1}, {3, 2}}} Or, if you like to drop trivial cycles of length 1, define In[38]:= toEssentialCycles[p_] := Select[ToCycles[p], Length[#1] > 1 & ] and get In[43]:= toEssentialCycles /@ y Out[43]= {{}, {{4, 3}}, {{3, 2}}, {{3, 4, 2}}, {{4, 3, 2}}, {{4, 2}}, {{2, 1}}, {{2, 1}, {4, 3}}, {{2, 3, 1}}, {{2, 3, 4, 1}}, {{2, 4, 3, 1}}, {{2, 4, 1}}, {{3, 2, 1}}, {{3, 4, 2, 1}}, {{3, 1}}, {{3, 4, 1}}, {{3, 1}, {4, 2}}, {{3, 2, 4, 1}}, {{4, 3, 2, 1}}, {{4, 2, 1}}, {{4, 3, 1}}, {{4, 1}}, {{4, 2, 3, 1}}, {{4, 1}, {3, 2}}} Regards, Wolfgang Jorge Luis Llanio wrote: > Hi everybody in the list! > > please, I need the listing of the symmetric S_4 group elements, ex.: > > (1)(2)(3)(4); (1234); (12)(34), etc a total of 4! = 24 elements > > > Thank you very much in advance, Jorge > >