|go ahead... be a heretic|
Permutation of groupsby tomazos (Deacon)
|on Nov 19, 2006 at 18:00 UTC||Need Help??|
tomazos has asked for the wisdom of the Perl Monks concerning the following question:
Suppose I have a list of peoples names:
I want to arrange them into teams:
In fact, I want to get all possible teams:
But not by iterating over them and storing them in a table, because there isn't enough memory.
Instead I want a function that takes a scalar number and returns a given grouping and visa-versa:
I understand this has something to do with algorithms for perumtations, combinatorics, stirling numbers of the second kind, etc, etc.
Can anyone give me some pointers on where to look, or what the algorithm is called? Or even write a quick version of lookupteam and constructteam?