Recent content by rasman

  1. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    After subsequent runs, it looks like Hurkey's algorithm is really closer to 136.705 ms. Amazing! I'm pretty sure that's unbeatable.
  2. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    And we have a winner! Excellent work, Hurky! I never, in 10,400,600 years, would have come up with that myself! The final results: A gave 10400600 and took 1582.985 ms B gave 10400600 and took 607.255 ms C gave 10400600 and took 354.218 ms D gave 10400600 and took 296.483 ms
  3. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    Very interesting. I might give yours a try then. Thanks for avoiding the old (and no longer true) "java is slow" jokes.
  4. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    Hmm.. I'm not sure I can bring myself to use a goto. And my target language is java, anyway. I have modified CRG's algorithm to do the shifting in the for loops. The factor of 12 that I mentioned before was incorrect because I had forgotten to do the sum to get the actual value in my...
  5. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    Oh, wow. I had misunderstood CRGreathouse's algorithm. I don't need to do the countBits() part, because the for structure was guaranteeing it for me already! Now his code is really kicking mine's ass. (0.133s to 1.7s for "26 choose 13") There's a reason that I stopped at "26 choose 13"...
  6. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    I am pre-computing the bit-counting tables. http://infolab.stanford.edu/~manku/bitcount/bitcount.html" was incredibly valuable in helping with that. The bit counting (really a table lookup) is hidden in that countBits() call. It's the enumeration of each value in the combination that I'm...
  7. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    Thanks for the effort, CRGreathouse. I implemented both your way and my way. For small numbers, like my "10 choose 5" example, my algorithm executes in half the time of yours every time. But somewhere around "16 choose 8" they even out, and when you get to "26 choose 13", the tables are...
  8. R

    Proof That "Moderation" Is Meaningless: All Comments Welcome

    What I meant by "so often" was "almost always if not always". "Do everything in moderation" is just a phrase that means "don't stuff too much or too little", which is an idiotic thing to say, especially when the "too much" and "too little" thresholds are completely arbitrary.
  9. R

    How Can You Efficiently Enumerate Combinations of Bits in Programming?

    Let's say I have 10 items, and I want to examine every combination of 5 items. Obviously, there are http://www.google.com/search?q=10+choose+5" possible combinations. But I want to actually enumerate them and iterate through them as efficiently as I can in a computer program. I'm wondering...
  10. R

    Proof That "Moderation" Is Meaningless: All Comments Welcome

    Hello. I'd be curious to know what you all think about my proof that the phrase "in moderation" is so often meaningless. The rest of the proof is http://www.erik-rasmussen.com/blog/2006/08/23/moderation-proof/". All comments welcome. Cheers!
Back
Top