Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] From a Math Prof (physics BS major) at my institution ( math challenge)



The first time you pick a random number between 1 and 35. The second time, you re-number the “balls” and pick a random number between 1 and 34. The third selection is between 1 and 33. Etc. You’ll have to keep track of and restore their original labels somehow.

With just a few million samples and a good pseudo-random number generator, like Mersenne Twister, your result will probably be just fine. But in general, cutting random numbers from your sample because their values don’t meet some arbitrary criteria, gives you a sample which is less random. In fact, the random numbers your algorithm discards are the ones most likely to result in sequential digits with my algorithm.

Actually, the more I think about this, the less I like your algorithm. By the time you are selecting the 5th ball, you are discarding 4 out of every 35 numbers generated. That’s really going to clip some odd sections out of the distribution. And they’re not random.

Paul


On Feb 26, 2014, at 11:40 AM, brian whatcott <betwys1@sbcglobal.net> wrote:

If the intention is to draw five integers in the range 1..35 from a hat, what do you do if you draw a number that's already drawn?

Brian Whatcott Altus OK