in reply to Re: Subsets and adjacent values
in thread Subsets and adjacent values
What powerset() is really doing is producing all the sub-sequences (with gaps between elements allowed) of the input sequence. If your input sequence contains distinct elements, then you can think of it as being a set and think of all of the generated sub-sequences as subsets. That is, there is a correspondence between a sequence of distinct elements and the set consisting of those elements.
So, the powerset() routine can be used to produce either 1) all the sub-sequences of a given sequence or 2) all the subsets of a given set.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Subsets and adjacent values
by blazar (Canon) on May 30, 2008 at 18:55 UTC | |
by pc88mxer (Vicar) on May 31, 2008 at 17:48 UTC |