Re: number generator
On Wed, 14 Mar 2007 19:25:46 +1100, Steven D'Aprano wrote:
Ignore that count. I don't know where I got 11,294 from, the correct
figure is 10,358.
Oh, I seem to have found a bug in the _partitions() function. I believe it
is missing some of the partitions.
[(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2)]
[]
--
Steven D'Aprano
On Wed, 14 Mar 2007 19:25:46 +1100, Steven D'Aprano wrote:
Now that I've seen your _partition() function, I'm quite impressed. It is
still brute-force, but it avoids generating all 50**5 non-unique lists. By
my count, it only has to throw away 11,294 lists to generate the 2611
unique lists it returns.
still brute-force, but it avoids generating all 50**5 non-unique lists. By
my count, it only has to throw away 11,294 lists to generate the 2611
unique lists it returns.
figure is 10,358.
Oh, I seem to have found a bug in the _partitions() function. I believe it
is missing some of the partitions.
>>list(_partiti ons(25, 24))
>>list(_partiti ons(25, 25))
--
Steven D'Aprano
Comment