Arbitrary Random Numbers in C: Generations for Monte Carlo Simulation Without Atmospheric Noise

I know there are other questions like this, however the next question relates to generating random numbers of arbitrary accuracy in C for use in Monte Carlo simulation.

How can we generate arbitrary arbitrary numbers of arbitrary accuracy in C when atmospheric noise is not always available without relying on disk i / o or network access, which would create bottlenecks?

libgmp is capable of generating random numbers, but like other implementations of pseudo random number generators , it requires seed . As the manual says, "system time is pretty easy to guess, so if unpredictability is required, then it definitely shouldn't be the only source of seminal value."

Is there a portable / portable library for generating random numbers or seeds for random numbers? Libgmp also mentions that "on some systems there is a special device / dev / random that provides random data more suitable for use as a seed." However, /dev/randomthey /dev/urandomcan only be used on * nix systems.

+3
source share
3 answers

Do not overestimate the importance of seed.

Firstly, this should not be really chaotic - just for a good distribution and not to correlate with any processes in your simulator or pseudo-random generator.

Secondly, for the statistical characteristics of Monte Carlo, it is not the randomness (in any sense) of a certain number that matters.

Low bytes of high precision time or some derivatives of keyboard and mouse actions make a good seed for everything that will run on a regular PC.

+2
source

. /dev/random ( ) . * ix - Entropy Gathering Demon./dev/urandom , , .

-API, , HotBits ( ), LavaRnd (CCD) Random.org ( , , ). .

( ) Windows * ix.

+2

? " 0 ". .

0
source

Source: https://habr.com/ru/post/1746796/


All Articles