V
V
vldkr2013-03-03 17:46:45
C++ / C#
vldkr, 2013-03-03 17:46:45

The adequacy of the pseudo-random number generator?

Hello Khabravchan!
Just the other day, I wondered what arithmetic algorithm to use for a pseudo-random number generator (hereinafter - PRNG). Due to the fact that the AVR ATmega8 does not have a normally working PRNG, as well as a strong desire to study this topic in more depth, I ask you for help.
Please, tell me the out-of-the-box tests for determining the proximity of PRNG to random numbers. Also, if you are interested in this topic, in the near future I plan to write an article for Habr, and if you think that some aspect deserves attention, feel free to write!
Attached is a comic on the subject.
8793840b05dcc2e840cebd99cb8c193d.jpg

Answer the question

In order to leave comments, you need to log in

5 answer(s)
J
jcmvbkbc, 2013-03-03
@vldkr

out-of-the-box tests for determining the proximity of GPSL to random numbers

Dieharder

G
Gribozavr, 2013-03-03
@gribozavr

Take one of the ready-made generators and don't reinvent the wheel. When implementing PRNG, it is very easy to make mistakes that are not noticeable at first glance.
Take, for example, from [1] the implementation of mt19937 and forget.
[1] llvm.org/viewvc/llvm-project/libcxx/trunk/include/random?view=markup

A
Arsen, 2013-03-04
@mekegi

2nd volume of The Art of Programming by Donald Knuth
There the first half of the book about Random Numbers
Exhaustive calculations on the subject

V
Vladimir Martyanov, 2013-03-04
@vilgeforce

Judging by the "cryptography" tag, are you going to use PRNG to generate some cryptographic key? Then you still need to think about ensuring that there is enough entropy.
And the generator, for example, is done like this: Xn=X_{n-1}*C+1 where C is some number. Additionally - a cyclic shift by 13 bits, for example.

M
Maxim Kuzovlev, 2013-03-04
@KY3EH

There was already a similar question , maybe you will find something interesting for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question