On 5/2/22 7:03 PM, Magnus Danielson via time-nuts wrote:
Hi Jim,

Thanks for the corrections. Was way to tired to get the uniform and normal distributions right.

rand() is then by classical UNIX tradition is generated as a unsigned integer divided by the suitable (32th) power of two, so the maximum value will not be there, and this is why a small bias is introduced, since 0 can be reached but not 1.

I'll bet it's "pre-Unix" -

System/360 Scientific Subroutine Package Programmer's Manual, Version III, DOI: 10.3247/SL2Soft08.001 says 1968 version, but I'm pretty sure the SSP is older (it is Version 3 after all)

I used it on an IBM 1130 as a mere youth in 1969

http://media.ibm1130.org/1130-106-ocr.pdf


    SUBROUTINE RANDU(X,IY,YFL)
    IY = IX*899
    if (IY) 5,6,6
5   IY=IY+32767+1
6   YFL=IY
    YFL=YFL/32767.
    RETURN
    END


GAUSS does normal distribution, with this comment:

Y approaches a true normal distribution asympototically as K approaches infinity. For this subroutine, K was chosen as 12 to reduce execution time.

It also helps that the variance of a uniform distribution is 1/12, so summing 12 numbers produces a distribution with a variance of 1.


But it's older than that.. I found a reference to it in some documentation for 7090 from 1961.  Since Unix wasn't even a name until 1970...



In practice the bias is small, but care is taken never the less.

Yes, that's a clever technique.

And the less said about the actual "randomness" of generators from that era, the better.



Cheers,
Magnus
_______________________________________________
time-nuts mailing list -- [email protected] -- To unsubscribe send an 
email to [email protected]
To unsubscribe, go to and follow the instructions there.

Reply via email to