Generation of uniformly distributed random numbers (0,1) - page 10

 
alsu >>:

Вы не правы, если стоит задача обеспечить генерацию последовательности СЧ заданной разрядности (заранее неизвестной), о чем и спрашивал топикстартер, то важна именно случайность - только тогда можно получать последовательности чисел с разрядностью по выбору и с "хорошими" характеристиками. Если же комбинировать значения, выдаваемые генератором ГПСЧ, то характеристики процесса не будут в общем случае "хорошими" и тот же DIEHARD он скорее всего не пройдет.

Did you see that it's not a PRNG, it's an RNG? :)

 
SProgrammer >>:

Вы видели что это не ГПСЧ, а именно ГСЧ? :)

RNG differs from PRNG in that it has a source of entropy (i.e. randomness independent of the generation algorithm used). In my example it is present - in this case it is a clock counter.

 
alsu >>:

ГСЧ отличается от ГПСЧ наличием источника энтропии (т.е. случайности, не зависящей от используемого алгоритма генерации). В приведенном мной примере он присутствует - в данном случае это счетчик тактов.

I'm only talking, sorry, about what I linked to. And how to use it. :) It's not a PRNG, it's an RNG. :)


But in general, talk about nothing - any generator that does not use external sources is not a random number generator, but only pseudo. ANY ONE :)

 
Quite right, absolute randomness is a mathematical abstraction. There is only a degree of approximation to it, well, and a degree of awareness of the object.
 
if(MathRand()+1>16383.5){rand+=MathPow(2,- i);

gumgum, MathPow() is an extremely slow function. I recently posted a study. And here you have an integer degree, and it's a natural number. Write a clever emulator of natural to the natural degree.

 

1000000 numbers rstep=32 rsign=1 speed = 4.97700000

if(MathRand()+1>16383.5){rand+=MathPow(2,- i);}
1000000 numbers rstep=32 rsign=1 speed = 2.44900000
double ranD(int rsign,int rstep)
{
double div=2;
double rand=0; 
   for(int i=1; i<= rstep; i++)
   {
   //if(MathRand()+1>16383.5){rand+=MathPow(2,-i);}
   if(MathRand()+1>16383.5){rand+=1/ div;}
   div= div*2;   
   }
      if( rsign==1)
         {
         rand=2*rand-1;
         }
return(rand);
}




 
Can someone make a dll for example from Random Number Generation? Thank you.
 
gumgum >>:
Может кто нибудь сделает dll например из Генерация случайных чисел? Спасибо.

and not on your own?

 
alsu >>:

а самостоятельно нэ?


I don't know how to create a dll. I'm downloading VS now, I'll figure it out and write. Just who has already created a dll it's not that difficult (I think so) if the sources are all available....
 
gumgum >>:


Я не умею создавать dll. Сейчас качаю VS, разберусь и напишу. Просто кто уже создавал dll это не так уж сложно(я так думаю) если исходники все имеются....

there is a recent article on the fifth forum on this subject, all for beginners with pictures and examples

Reason: