From: Chris Pine Date: 2003-04-19T07:57:21+09:00 Subject: Re: Biased weighted random? ----- Original Message ----- From: "Hal E. Fulton" I've also noticed that for sufficiently strange weights, Chris's method blows up with some ridiculuous Avogadro-style numbers. Could be partly a roundoff issue... ---------------------------- Hmmm... could be. You could use Rationals instead of floats. I did at first, but it was *much* slower. Plus, I was iterating, anyway, so I had no sense of mathematical pride about it. :) I noticed it giving strange answers when I asked it to do something impossible (like weights 3 and 1), but otherwise it seemed ok... has this not been your experience? If we solved this the *right* way, it would probably tell us we were dividing by zero (or something) in these impossible cases. Chris