Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to generate true random numbers using software only?

Looking around a bit I have found that most solutions for generating a true random number involves inspecting natural phenomenon.
But is it really necessary?
I mean, assuming that Pi has random infinite sequence of digits as far any system could tell, couldn't we just build an algorithm which will look something like this (assuming 64 bits architecture):

  1. Take the first 64 bits.
  2. Cast the bits into double
  3. Take next 64 bits
  4. Cast the bits into double
  5. etc...

Of course this could be enhanced (involving seeds, casting to Integers and so on...)

Does this sounds right or am I missing something?

Note:
About the assumption about pi, according to Wikipedia it is widely believed that Pi is a Normal number. Shouldn't this be enough? If it can't be disproved, Shouldn't it be enough for any practical system?

like image 854
Avi Turner Avatar asked Dec 07 '22 04:12

Avi Turner


1 Answers

No, it's absolutely not possible!

On a deterministic machine, you can compute deterministic sequences. There is no randomness to be found. Even chaotic systems are just deterministic sequences.

You can indeed generate a deterministic sequence which appears to have the same distribution of digits as one would expect from a randomly generated one. But it's still deterministic.

Pi is completely deterministic: If you and I both generate the sequence of digits in Pi, we both get the same numbers.

I believe you are right in saying the distribution of digits seems to be uniform: but this raises the obvious question: where do we start? We need to choose a random place to start in the sequence to make it 'truly random': thus we are back to square one.

In practice we use sources of what seems to be randomness: Linux will look at times between disc accesses, and keystrokes, and the exact time. But with a little work we can predict all of these more and more accurately, or alter them by fixing our environment.

Hardware random number generators use quantum processes which are believed to be truly random. For example, performing a quantum measurement is believed to be a perfectly random process: no 'better' knowledge of the initial state can help predict the output state (as with chaotic systems).

A paper absolutely worth reading on this subject is "On random and hard to describe numbers" by Bennett, it's quite easy to find with a quick Google.

And here's a nice related XKCD :)

This reminds me of an XKCD...

like image 190
Ross Hemsley Avatar answered Mar 13 '23 19:03

Ross Hemsley