help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding all subsets


From: Mike Miller
Subject: Re: Finding all subsets
Date: Tue, 5 Jul 2005 09:02:57 -0500 (CDT)

On Tue, 5 Jul 2005, Soren Hauberg wrote:

I can't seem to wrap my mind around a very simple problem.
I need to find all possible subsets of a set.
Example:
All possible subsets of
[1, 2, 3]
is
{ [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3] }

Is [] (null set) also a subset?

An n-vector has 2^n subsets, if the null set is included.

I'm not sure what the best way is to extract the subsets and I don't know how you want them organized in matrices or whatever.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]