Re: Multiplying permutations
- To: mathgroup at smc.vnet.net
- Subject: [mg41751] Re: Multiplying permutations
- From: "Carl K. Woll" <carlw at u.washington.edu>
- Date: Wed, 4 Jun 2003 08:34:36 -0400 (EDT)
- Organization: University of Washington
- References: <bbhvu4$75u$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Wolfgang,
Here is one possibility:
p_\[CenterDot]q_ :=Range[Length[p]][[Ordering[p]]][[Ordering[q]]]
where I use \[CenterDot] (which has the alias esc . esc) for the product.
For your example,
In[16]:=
p={3,1,2};
q={2,1,3};
p\[CenterDot]q
Out[18]=
{3, 2, 1}
as you requested.
Carl Woll
Physics Dept
U of Washingont
"Dr. Wolfgang Hintze" <weh at snafu.de> wrote in message
news:bbhvu4$75u$1 at smc.vnet.net...
> 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
>