Re: 32-bit random numbers
- Posted by "Igor Kachan" <kinz at peterlink.ru> Jul 10, 2004
- 589 views
Hi Al, ---------- > From: Al Getz <guest at RapidEuphoria.com> > To: EUforum at topica.com > Subject: Re: 32-bit random numbers > Sent: 10 jul 2004 y. 21:10 > > posted by: Al Getz <Xaxo at aol.com> > > > Hi igor, > > "K * (rand(N) - 1) + rand(K) - 1" > > It looks flat, but what is your intended advantage over > N*(rand(N)-1)+rand(N)-1, {N=#1000} > ?? Al, the proposed function is: constant K = 1073741823 -- max EU integer function rand_atom(integer N) return K * (rand(N) - 1) + rand(K) - 1 end function Did you see in explanation that N << K ? This parameter (N) is the key to understanding of flat character of this distribution. We need the maximum range of integer random atoms with step = 1 in EU. This is our task now. And I am just trying to solve this concrete task as far as I understand it. Yes, formulas are similar, but they are *different*, Al. I can say nothing about the distribution on your formula. I just see it is not flat. But you do see just now that proposed new function seems to give the flat distribution. > Notice you can also extend that one: > > N*(rand(N)-1)+rand(N)-1 > > goes to: > > N*N*(rand(N)-1)+N*(rand(N)-1)+rand(N)-1 > > if N is an integer multiple of the number > of terms minus 1, > or: > > N*N*(rand(N2)-1)+N*(rand(N2)-1)+rand(N2)-1 > > if N2=number of terms minus 1 . > > This gives the ability to get higher > and higher random numbers OK OK OK, Al, what a problem, use please your functions as you want for the suited tasks, and tell us what were the distributions. > > Take care, > Al Regards, Igor Kachan kinz at peterlink.ru