MathGroup Archive 2004

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

Search the Archive

Re: Powerset operation: how?


see.address at post.sig wrote:

> How should I code efficiently the powerset of a (small) set represented by a
> list?
> 
> A search on Wolfram site turned out nothing useful, but I'm quite sure
> somebody has done it already.

Three or more functions atre provided by


<< "DiscreteMath`Combinatorica`"

Sort[GrayCode[{1, 2, 3}], Length[#1] < Length[#2] & ]

Sort[Subsets[{1, 2, 3}], Length[#1] < Length[#2] & ]

BinarySubsets[{1, 2, 3}]

-- 

Roland Franzius


  • Prev by Date: usage logs from mathlm
  • Next by Date: Re: Powerset operation: how?
  • Previous by thread: Re: Powerset operation: how?
  • Next by thread: Re: Powerset operation: how?