Re: Multiplying permutations
- To: mathgroup at smc.vnet.net
- Subject: [mg41837] Re: Multiplying permutations
- From: "Dr. Wolfgang Hintze" <weh at snafu.de>
- Date: Fri, 6 Jun 2003 09:51:14 -0400 (EDT)
- References: <bbhvu4$75u$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Thank you all very much for you interesting contributions. 1) What I didn't find (because of my impatience) was the Combinatorica command Permute[]. 2) I find Carl's suggestion p_\[CenterDot]q_:=q[[p]] very attractive as it resembles the definition of the product (carry out one permutation after the other) most and has the advantage of being typed in easily and being well legible (p . q). 3) Using the idea of Kai's matrix approach I tried to define an nxn matrix P corresponding to a permutation p by (e = {1,2,...,n}) Solve[P.p == e, P] but it didn't work. Any hints if there is a way to find P along this line would be helpful. Wolfgang Dr. Wolfgang Hintze wrote: > Is there a simple command in Mathematica to multiply two permutations, > i.e. to carry out one after the other? > > I looked at the packages DiscreteMath`Permutations` and > DiscreteMath`Combinatorica` but couldn't find it. > > Example > > p = {3,1,2} mapping: 1->3, 2->1, 3->2 > q = {2,1,3} mapping: 1->2, 2->1, 3->3 > p.q = mappings (p first, then q) > [1-p->3-q->3, 2-p->1-q->2, 3-p->2-q->1] > = {3,2,1} > > Any help appreciated > > Wolfgang > >