Advertisement

To heck with random numbers...

Started by May 01, 2000 04:38 PM
18 comments, last by Spiff 24 years, 7 months ago
I''ve got a little thesis I''d like you to have a look. Keep in mind that I''ve read very little math so it''s completely out of the blue... I believe that there is no possible way of calculating a random number on a computer. C++''s rand() procudes pseudo-random numbers as well as VB''s rnd() too (Microsoft''s help files say that). I''ve also found a document on how to produce pseudo-random numbers at FlipCode, based on some university research of some kind, so it''s got me thinking. Of course you can come pretty close (and for a normal user quite enough) to a random series of numbers, but not "really" random. An example is VB''s rnd() that is based on the current system time, which in this case is cheating. No matter what complex algorithms you use, everything in math is constant and no random things exists at all. Or was I asleep when my math teacher explained this... Please, prove me wrong. ============================ Daniel Netz, Sentinel Design "I'm not stupid, I'm from Sweden" - Unknown
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
You can''t be proved wrong. It''s a fact that you can''t have purely random (digital) numbers.

When I init the random queue:
srand(TimeGetTime()); // this may not be the right syntax

I am going to get the same list of numbers if I do this command exactly when the system clock rolls over. When this is, I don''t have a clue, but it will happen some time.

The closest you could get would be to attach some physical device (a wheel, etc) to a serial port and poll it for random values. This may not qualify as random either, BTW, but it would be closer.
Advertisement
you''re right, nothing is truly random. there''s actually a whole science devoted to this, synergetics (study of chaos)

-goltrpoat


--
Float like a butterfly, bite like a crocodile.

--Float like a butterfly, bite like a crocodile.
This is (mostly) correct, and why most computer random number generators are more fully called PSEUDO random number generators. They follow an algorithm and, while possibly very hard to predict, still follow a pattern.

However, there are truly random things. (Your agreement with this will depend, in the end, on philosophy more than mathematics.) Getting the computer to generate truly random numbers involves an outside stimulus.

If you want more info on this sort of thing, check out:

http://www.random.org/

and for a cool way of getting random numbers:

http://lavarand.sgi.com/


---- --- -- -
Blue programmer needs food badly. Blue programmer is about to die!
One example of TRUE randomness is radio-active decay. There is no way to predict when a radio-active neucleus will emmit particles. This is all backed by quantim mechanics.

TRUE Digital randomness dosent exist but for our purposes its probably good enough. And probably better that it isn't really random as it makes for much easier syncronization for multi-player games

Edited by - UraniumRod on 5/1/00 6:01:08 PM
------------------------------"My sword is like a menacing cloud, but instead of rain, blood will pour in its path." - Sehabeddin, Turkish Military Commander 1438.
I believe nothing is "truly" random, I think it''s really just theoriticall (spelling). Even when playing with dice - your just manipulating a cube to give you numbers, but they arent really random...
Advertisement
Interestingly, some computers that require truly random numbers often use integrated geiger-counters and count the ticks over a fixed time for their numbers.

Some guys at SGI recently found a cheaper solution, though. They pointed a camera at a lava lamp and used calculations on the resulting images to generate their numbers.

(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually still available on store-shelves, although you'll need a keen eye to find them nowadays. He continues to work in the casual game-space as an independent developer, largely working on games in Flash for his website, The Code Zone (www.thecodezone.com). His current scheme is to distribute his games virally on various web-portals and widget platforms. In addition, John writes weekly product reviews and blogs (over ten years old) for www.gamedev.net from his home office where he lives with his wife and daughter in their home in the woods near Lake Grapevine in Texas.

Intel came out with a chip that generates "true" random numbers by measuring something in nature that is random. The generator is in the Pentium III chip.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away"--Henry David Thoreau
I guess you could say every number generated was actually determined at the time of the Big Bang. Ok, if you lean the other way, it would''ve been when God said, "Let there..."

Someone would have to issue a:
SysReboot(&this->Universe()); // not recommended

In order to get a different srand() seed.
You could have your program download some current stock market index from the web to send to srand(). Of course, the stock market is chaotic, not random. ~

This topic is closed to new replies.

Advertisement