Re: Cyclic permutations
- To: mathgroup at smc.vnet.net
- Subject: [mg79534] Re: Cyclic permutations
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Sat, 28 Jul 2007 05:44:29 -0400 (EDT)
On 7/27/07 at 6:04 AM, drmajorbob at bigfoot.com (DrMajorBob) wrote: >Won't that SameTest equate a lot of permutations that aren't the >"same" in the OP's requested sense? >perms = Permutations[Range@4] Signature /@ perms Union[perms, >SameTest -> (SameQ @@ (Signature /@ {##}) &)] >{{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}} >{1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, >\ 1, 1, -1, -1, 1} >{{1, 2, 3, 4}, {1, 2, 4, 3}} >Only two distinct permutations exist (for ANY list) with that >SameTest. >I thought the OP wanted something like >Union[perms /. {a__, 1, b___} :> {1, b, a}] >{{1, 2, 3, 4}, {1, 2, 4, 3}, {1, 3, 2, 4}, {1, 3, 4, 2}, {1, 4, 2, >3}, {1, 4, 3, 2}} I think your assessment is correct. I had thought Signature returned different values for permutations that were not cyclic versions of each other. I see on looking at the documentation this isn't the case. Sorry for the confusion I perhaps caused. -- To reply via email subtract one hundred and four
- Follow-Ups:
- RE: Re: Cyclic permutations
- From: "King, Peter R" <peter.king@imperial.ac.uk>
- RE: Re: Cyclic permutations