Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

combinations of n objects 2 at a time

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15188] combinations of n objects 2 at a time
  • From: "Albert Maydeu-Olivares" <amaydeu at nil.fut.es>
  • Date: Fri, 18 Dec 1998 02:11:04 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,

In order to generate all combinations of n objects 2 at a time I load 
the `DiscreteMath` add-on.

 <<DiscreteMath`Combinatorica`

l[n_]:ÿrt[Ksubsets[Reverse[Table[i,{i,n}]],2]]


So that with nÿobjects I get

l[6]

{{2,1},{3,1},...,{6,4},{6,5}}

Any suggestions on how to do this without loading the add-on?


--

Albert Maydeu-Olivares				Tel. +34 3 4021079 ext. 3099 Faculty of
Psychology 				Fax. +34 3 4021362 University of Barcelona				E-Mail:
amaydeu at tinet.fut.es Passeig de la Vall d'Hebron, 171. 
08035 - Barcelona (Spain)



  • Prev by Date: Re: Together chokes with Prime Modulus > 46337
  • Next by Date: Compile and NormalDistribution
  • Previous by thread: Re: Combinations
  • Next by thread: Re: combinations of n objects 2 at a time