MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help ! complex permutations

  • To: mathgroup at
  • Subject: [mg7032] Re: Help ! complex permutations
  • From: uyurtsever at (Ulvi Yurtsever)
  • Date: Fri, 2 May 1997 21:30:56 -0400 (EDT)
  • Organization: AT&T WorldNet Services
  • Sender: owner-wri-mathgroup at

On 29 Apr 1997 21:40:11 -0400, Robert_P at (Robert Perkins)


E.g., for the case (your case, I think) when the ordering of elements
IS significant, you might do:

In[70]:= Flatten[Outer[f, {a,b}, {a,b}]]/.f->List

Out[70]= {{a,a},{a,b},{b,a},{b,b}}

In[71]:= Flatten[Outer[f, {a,b}, {a,b}, {a,b}]]/.f->List


For the case where the ordering is NOT significant (in which case the
total number of permutations is Binomial[n+|m|-1, |m|-1]), you might

In[72]:= Union[Map[Sort,Flatten[Outer[f,{a,b},{a,b}]]/.f->List]]


In[73]:= Union[Map[Sort,Flatten[
             Outer[f,{a,b},{a,b}, {a,b}]]/.f->List]]


(Caution: these are quick & dirty implementations; ie with no
attention paid to time or space efficiency.)

best wishes

Ulvi Yurtsever
Senior Research Scientist
Dynamics Technology, Inc.
21311 Hawthorne Blvd., Suite 300
Torrance, CA 90503-5610
(310) 543-5433, FAX: (310) 543-2117
email: uyurtsever at

  • Prev by Date: Re: WISINWIG fonts
  • Next by Date: Re: (...) Instabilities(?) in mma 30 under W95
  • Previous by thread: Re: Help ! complex permutations
  • Next by thread: Re: Help ! complex permutations