Re: Cyclic permutations
- To: mathgroup at smc.vnet.net
- Subject: [mg79423] Re: Cyclic permutations
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Thu, 26 Jul 2007 05:36:57 -0400 (EDT)
On 7/25/07 at 5:27 AM, peter.king at imperial.ac.uk (King, Peter R)
wrote:
>I have a set of permutations eg.
>{a,b,c,d}, {a,c,b,d} {b,c,d,a}
>Some of which are just cyclic variations of others (ie. {b,c,d,a} is
>a cyclic variant of {a,b,c,d}). Is there a simple way of getting rid
>of these, so that the above set just becomes
>{a,b,c,d}, {a,c,b,d}
>I am quite happy to select the cyclic variant to be kept arbitrarily
>(or using lexical ordering, I'm not particularly concerned).
One way to do this would be to use Union with Signature, i.e.,
In[5]:= Union[{{a, b, c, d}, {a, c, b, d}, {b, c, d, a}},
SameTest -> (SameQ @@ (Signature /@ {##}) &)]
Out[5]= {{a, b, c, d}, {a, c, b, d}}
--
To reply via email subtract one hundred and four