[Haskell-cafe] random shuffle and random list partition
manlio_perillo at libero.it
Fri Mar 20 20:18:11 EDT 2009
Yitzchak Gale ha scritto:
> Hi Manlio,
> Manlio Perillo wrote:
>> For my Netflix Prize project I have implemented two reusable modules.
>> The first module implements a random shuffle on immutable lists...
>> The second module implements a function used to partition a list into n
>> sublists of random length.
> As you point out, your partition algorithm is not fair.
> Using your Random.Shuffle and a well-know trick
> from combinatorics, you can easily get a fair
> partitions function:
Someone added an alternative implementation:
More information about the Haskell-Cafe