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

 
Mathemat >>:

gumgum, тогда попробуй вот так. Принцип тот же, но вместо генерации целых чисел от 0 до 32767 ты получишь примерно от 0 до 2^30. Каждое число - это MathRand() + MathRand()*32768. Я не исследовал, как будут распределены, но надеюсь, что для не слишком требовательных задач все будет тип-топ.

Это числа вида AB в 32768-ичной системе счисления.

А еще лучше все-таки использовать dll. Есть такая, она сразу генерит такие большие числа.

Alexey, for generating pseudo-random sequences, for example, if you use a linear shift register or Fibo, I remember, the lags of the generator are extremely important, i.e. those register positions from which the feedback is taken. It seems to me that if you use your scheme, the lag may be broken and unplanned correlations may occur between the elements of the sequence

 
Mathemat писал(а) >>

gumgum, here is another link: https://forum.mql4.com/ru/19996/page4. But it has dll, but the generator is kind of cryptographic, i.e. more advanced than standard crt one. And it generates much more numbers, from -2^31 to 2^31. All you need can be found in the same branch.

You don't have to generate numbers. You need to generate lots and lots of very random ones, and set every time a new offset point from something also very random and unclear)))). Almost all oscillators work this way.

 
Figar0 >>:

Буквально на днях читал описание этого эксперимента. Понял что не потяну) Может это как раз описание Вашего опыта?

Ну такое мне наверно все же не надо, я видел что-то типа где последовательность инициализировалась системным временем или чем-то подобным... Ну как обычно, когда надо - не найдешь)

З.Ы. Кажется это было на форуме каких-то лотерейщиков, никто не встречал?

Nah, I haven't done that in a while...

As far as I know, modern software DSPs use the processor clock counter as the entropy source

 
Mathemat >>:

gumgum, вот еще ссылочка: https://forum.mql4.com/ru/19996/page4. Но там с dll, зато генератор типа криптографический, т.е. более совершенный, чем стандартный из crt. И чисел намного больше генерит, примерно от -2^31 до 2^31. Все нужное найдете в той же ветке.


Thank you. But I need real numbers in the range (0, 1).
 
alsu >>:

Алексей, для генерации псевдослучайных последовательностей, например, если используется линейный регистр со сдвигом или Фибо, помнится, крайне важны лаги генератора, т.е. те позиции регистра, с которых берутся отводы обратной связи. Мне кажется, если использовать указанную тобой схему, то лаговость может нарушиться и между элементами последовательности возникнут незапланированные корреляции

Thank you, alsu. I'm not insisting, just suggesting an option. I didn't know about such subtleties.

But I need real numbers in range (0, 1).

Then I'll have to write it myself, I haven't seen such ready-made recipes. Generate digits separately and then glue them together into a number.

 
Mathemat >>:

Спасибо, alsu. Я и не настаиваю, а только предложил вариант. О таких тонкостях я и не знал.

Тогда придется писать его самостоятельно, тут подобных готовых рецептов не видел. Генерить цифры отдельно, а потом склеивать их в число.


That's what I did.
 

really good real and integer generators. http://www.agner.org/random/ with a period of 10^8100 somewhere.

 
gumgum >>: Дык я так и делал.

Yes, I've noticed. But it will be slow. Probably better to make a binary number first and then convert it to decimal. There's a conversion library here.

 

here is one of the fastest random (not pseudo) number generators available today.

Or there's a simpler one, but it's also fast and has good features

 
alsu писал(а) >>

here is one of the fastest random (not pseudo) number generators available today.

Or there's an easier one, but it's also fast and has good characteristics.

What do you mean, not pseudo? There is no such thing in nature.