[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Help with an algorithm
- From: KHMan <keinhong@...>
- Date: Fri, 24 May 2013 15:38:20 +0800
On 5/24/2013 3:14 PM, Michal Kottman wrote:
For this small test case, it generates 252 number. For your case,
C(25,40) == 40225345056, which is over 40 billion numbers. Would
you like to rethink your original problem?
Oh yeah, I just wrote a complete implementation in Lua. Ran it on
Lua 5.2 on an old Athlon 2.6GHz, one core at full tilt. The final
number is calculated and a count is incremented, and it does
Setting to 10 hamming bits, it produces the expected count of
847660528 numbers in 125 seconds. For 25 hamming bits, the thingy
should complete in a few hours at most.
I split the number into segments of 8 bits, and using an
auto-generated lookup table for 8 bit combinations, it loops
several loops to join the bits together.
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia