best approach to generate random number in java

A

Alex Hunsley

Paul said:
Stephen Wolfram (Mathematica) has developed a particular cellular automaton
(rule 30) that he claims produces a very highly random number sequence. In
his recent book "A New Kind of Science" he shows patterns in the output of
most pseudorandom number generators (that's a "bad thing"(tm)), and the
output of his method is apparently much superior, despite being
conceptually very simple.

By the way, what do you make of Wolfram's books? They look interesting
(I've had a gander in book shops). I've heard people getting annoyed,
though, by his wide-reaching claims regarding the application of his
cellular automata work, etc.)

alex
 
P

Paul Lutus

Alex said:
By the way, what do you make of Wolfram's books?

I can only speak about "A New Kind of Science", which I just read. It is
rather grand in its claims, difficult to swallow whole. Time will tell. :)
They look interesting
(I've had a gander in book shops). I've heard people getting annoyed,
though, by his wide-reaching claims regarding the application of his
cellular automata work, etc.)

My opinion is that the author is isolated pretty much competely from the
real world, as a result of his personal history (too much success, too much
money). This doesn't mean the book's claims are false or even exaggerated,
but it does color the writing, making it seem disconnected from the
pedestrian world of corporeal organisms like us. :)

Just IMHO.
 
P

Paul Lutus

Alex said:
There is a difference between the determinism of an algorithm and the
predictability of the distribution of the numbers it produces...

Yes, true, but the existence of an algorithm that is shorter than the
resulting series does place the series in a different class -- unless, of
course, the algorithm cannot be found. This is how an engineer would say
it, anyway.
Also, I am assuming the user does not know where the starting point in
the sequence is.

That does put the question in a different light, unless infinite time is
available to perform tests. Given the latter, one could generate any number
of series and compare using a sliding window approach.

A real mathematician (which I am certainly not) would object on theoretical
grounds that if an algorithm exists that is shorter than the series, it is
child's play to find it. Well, infinite children, and infinite play. :)

/ ...
If you don't know the starting point in the sequence, knowing the
algorithm wouldn't matter - you have no idea when the sequence you see
will diverge from what might look like a 'familiar' sequence like
14159265358979.

See above, sliding window, infinite analysis time.
Unfortunately, this scheme wouldn't always work. For the computer to
guess the pi algorithm, you would have to

a) put in all the decimal places of pi (!)
b) leave the computer to run forever (!)

I agree, and I wasn't thinking of an infinite series above.
These requirements scupper the plan.... no matter how many qubits you
put in a quantuum computer, infinity still poses a problem.

Yes, quite.

/ ...
A well known rough test of how random information is: zip it up in
winzip. Now, I wonder what compression you get if you zip up a text file
containing places of pi?

I have done a lot of this as it turns out. Digits of Pi, e, etc, appear
quite random using this test, assuming the compression schemes are optimal
of course. Near the other end of the spectrum, plain-language text. And at
the far end of the spectrum, political speeches. :)

/ ...
Another digression:
I wonder what percentage of all possible permutations of information are
truly random and non-compressible?

But you used the word "information", so you have, perhaps inadvertently,
undermined your example. The set of stochastic processes is infinite, and
it is possible that the set of orderly proceses is also. Over time, entropy
turns some of the latter into the former.
 
A

Alex Hunsley

Paul said:
Alex Hunsley wrote:




I can only speak about "A New Kind of Science", which I just read. It is
rather grand in its claims, difficult to swallow whole. Time will tell. :)

I see. I have no plans to read it myself in the near future, but it had
some interesting things in it.
My opinion is that the author is isolated pretty much competely from the
real world, as a result of his personal history (too much success, too much
money). This doesn't mean the book's claims are false or even exaggerated,
but it does color the writing, making it seem disconnected from the
pedestrian world of corporeal organisms like us. :)

Just IMHO.

Interesting. I do know that it got slagged off a bit for being vanity
published....
 
M

Malcolm

It reminds me of the whole mandelbrot set thang: how such an amazing
structure is encoding by an eqn. as simple as z |-> z^2 + c (and knowing
how complex numbers work).
((I have started reading "The Road to Reality" by Roger Penrose which
touches on this theme at the beginning. Highly recommended book, if all
the maths doesn't put a spade in your head.))

Definitely a recommended book if you are into mathematics &
theoretical physics at a graduate level, but he doesn't have much on
programming or matters like random number generation. Still it's
always worth 'broadening' and this book will do that! Loadsa reviews
linked to from here if you think you might be interested:

http://www.321books.co.uk/reviews/the-road-to-reality-by-roger-penrose.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top