Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: Powerset operation: how?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45586] Re: Powerset operation: how?
  • From: Roland Franzius <roland.franzius at uos.de>
  • Date: Fri, 16 Jan 2004 06:05:01 -0500 (EST)
  • Organization: Universitaet Hannover
  • References: <bu2odb$jf9$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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?