exhaustive subsets

David Eppstein eppstein at ics.uci.edu
Fri May 14 01:15:45 EDT 2004


In article <mailman.0.1084510656.27251.python-list at python.org>,
 "Brett Calcott" <brett at coombs.anu.edu.au> wrote:

> I've found some python solutions to find the set of subsets for a given set,
> but how do you find the set of the set of subsets whose union is the given
> set and whose intersections is the empty set.
> 
> ie. Given a cake divided into 6 unique pieces (0-5), how many different ways
> can I distribute the cake so that there are no pieces left. eg.
> 
> ((0), (1,2,3,4))
> or ((0),(1),(2,3,4))
> or ((0,1),(2,3),(4))
> or ((0,4),(1),(2,3))
> 
> Is there a name for this problem?

Partitions?  Didn't we just have a discussion about them here a week or 
two ago?
<http://groups.google.com/groups?threadm=mailman.136.1083282936.25742.pyt
hon-list at python.org>

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science



More information about the Python-list mailing list