Give me a million! or where to get truly random numbers?

We need exactly one million random numbers. In principle, the accuracy of 1/256 suits me, so the question can be rephrased: where to get a million random bytes? Not pseudo-random, but random. I wanted to download it on random.org, they just upload files with a volume of megabytes every day. I need one, just one such file, from any date. This is enough for me for a lifetime (the specifics of the program are such that the sequence can be repeated between launches, the main thing is that "inside" it was completely random). And they don't give it there.: (

I even had that thought. We take the first large enough file (the iso image of the Windows distribution, for example). Cut into a million pieces. Each part will get about two kilobytes - quite enough, IMHO. For each part, we calculate the md5. Here are a million random numbers, and with an accuracy of not 1/256, but 2^-128, which is even too cool. ;) What do you think?

Author: Nick Volynkin, 2015-03-23

6 answers

Take the first million bytes of Pi : )

Upd. the formula BBP and, for example, the code in C will help.

Upd.2. about the randomness of digits in Pi and other fundamental constants.

 8
Author: Sergiks, 2015-03-25 13:02:40
  1. In addition to your comment. You do not perform correlation analysis, although you claim that your numbers are not random enough.
  2. Let's say it's not, but your approach in taking the hash of a chunk of a large file is the worst thing imaginable. The same md5 has dips in the spectrum.
  3. No algorithm can build truly random numbers.
  4. I advise you to look for specialized literature on this subject. I'm sure you'll definitely find the algorithm there, the most accurate one for your task (speed + correlation).
 4
Author: ArchDemon, 2015-03-25 20:16:45

Take make an array of records in order, and then "stir" it(php), you can take pieces and insert them into the database.

So much for a million random numbers.

 2
Author: Artem, 2015-03-24 06:37:27

There was also such a thought. Only the worm of doubt is gnawing: are these 16-kilobyte chunks completely independent of each other? What if you have to wait a day between downloads to get different pieces?

To test this, you need to take and test these sets. A lot of tests and techniques have been developed for this purpose.

In general, open the second volume of Knuth and read the entire third chapter. It deals with:

  • Generating uniformly distributed random numbers (including many different methods).
  • Statistical criteria (to verify that the sequence is indeed random).

I strongly doubt that on random.org or somewhere else they came up with something much better (well, except for the Schottky diode with thermal noise measurement) and their criteria for checking random numbers are somewhat different.

You can also search for the book "Entertaining projects based on tinyAVR Gadre D. microcontrollers", which describes how to make a Schottky diode +avr controller based on the the generator itself. A little more refinement - and it will issue them to the usb port (and there they can be read for your needs).

 2
Author: KoVadim, 2015-03-24 13:41:18

It seems to me that there is a substitution of concepts.

A random number is a number whose occurrence cannot be predicted (it is possible to guess).

A unique number is a number from a sequence in which there are no duplicate numbers, their order can be ordered.

 0
Author: Gorets, 2015-03-24 07:13:44
 0
Author: Qwertiy, 2015-05-01 21:36:57