
22 May
2007
22 May
'07
9:06 a.m.
Henning Thielemann schrieb:
On Mon, 21 May 2007, Steffen Mazanek wrote:
is there an efficient algorithm that takes two positive numbers n and m and that computes all lists l of numbers 0
For instance alg 5 1 = [[1]] alg 5 2 = [[1,1],[2]] alg 5 3 = [[1,1,1],[1,2],[2,1],[3]] ...
http://darcs.haskell.org/htam/src/Combinatorics/Partitions.hs
alg = flip partitionsDec
*Combinatorics.Partitions> partitionsDec 5 3 [[3],[2,1],[1,1,1]] so [1,2] is missing. And for these partitions I've also the attached module. *Partition> parts 3 [3,2 1,1 1 1] Christian