MathGroup Archive 1998

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

Search the Archive

combinations of n objects 2 at a time


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