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)



Some early attempts to “fix” pseudo-random number generator algorithms involved “corrections” like this. For example, if the generator produces numbers in the interval [0,1] you would expect that mean distance between pairs of numbers to be about 0.3 (or something… someone will correct me on that, I’m sure). But it could range from 0 to 1. For particular set of points in the period of this generator you might find that the distances between numbers are too large. So, you can keep track of the average distance for the last N points. If it gets too large, you cut the next large jump and select a new “random” number. The trouble here is that even an ideal random number generator will do this — it’s random after all. What you’ve done is cut off the tail of the expected Poisson Distribution and made the numbers “less random.”

That’s exactly what you’ve done. Except you’ve cut off near the zero end of the Poisson Distribution where the probability is quite high. That’s not random.

Paul



On Feb 25, 2014, at 6:00 PM, brian whatcott <betwys1@sbcglobal.net> wrote:

Paul Nord wrote:

*************************
You are throwing out random numbers when you don’t “like” them. Specifically, you generate new random
numbers whenever the numbers are too close together. Are you sure that’s random? Granted, it probably won’t break the Mersenne Twister generator used by Octave. But it is suspicious that you are discarding things which look very much like the pattern for which you are searching. Wouldn’t it be better to do a: for n=35:31 … rn =
fix(1+rand*n) … end and then map those numbers onto the integers in the list? Paul
************************

It looked to me like a row of integers was scanned as each integer was added to see if it duplicated any other integer in the row: if it did, it was discarded in favor of another candidate.

Brian Whatcott Altus OK