Mon, Nov 25, 10:01 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 25 12:38 pm)



Subject: OT: How do computers make random numbers???


tebop ( ) posted Fri, 26 September 2008 at 9:19 PM · edited Mon, 25 November 2024 at 9:57 PM

I"ve been thinking this . if man made computers , aren't we supposed to be able to predict their outputs?  Well, apparently we cant. 

I do some programming for example.. and to make a random number you just use a keyword that tells the computer to make a random number.

But mathematically or electricallly speaking, how did the inventors of CPU's make a machine decide what random is? and how are those numbers chosen by the computer?

does it depend on some physics inside the cpu components? for example in real life you can say 
random means whenever a leaf falls from the tree. that is very unpredictable. So is it something like this inside the processor or something that makes it decide what a random number is?

 


Acadia ( ) posted Fri, 26 September 2008 at 10:02 PM · edited Fri, 26 September 2008 at 10:02 PM

Computers are machines that can only do functions based on what is input into them by people. Therefore they can't actually generate a truly random number; instead they generate psuedo-random numbers based on variables such as time, so there is always some kind of pattern involved. 

There is more to that explanation than that, but that's all I remember from what my ex told me when I asked him that same question.  He went into 1's and 0's and stuff and completely lost me at that point!!

"It is good to see ourselves as others see us. Try as we may, we are never
able to know ourselves fully as we are, especially the evil side of us.
This we can do only if we are not angry with our critics but will take in good
heart whatever they might have to say." - Ghandi



geoegress ( ) posted Fri, 26 September 2008 at 10:32 PM

Yeah- what Acadia said.

The rnd command allways has a seed. It's been like this every sence basic basic was invented. It's that seed that you can then apply a function to.
Date or time or cpu cycles are often used.

It's such a concern that in vagas there is a company that runs a network that generates random numbers on a main frame that is used by almost all of the big slot machines. It's been running for years just to keep the cycle so deep so no one can figure out it's seed. Know the seed and function method  then you could- in theory- predict.


nruddock ( ) posted Fri, 26 September 2008 at 10:37 PM

Attached Link: http://en.wikipedia.org/wiki/Hardware_random_number_generator

There is specialist hardware available to generate really random numbers.

Software RNGs can pass many statistical tests, but they are always deterministic.


tebop ( ) posted Fri, 26 September 2008 at 10:47 PM

Thanks all. I started searching about the web and it's interesteing. hehehe. i never knew about it. 


momodot ( ) posted Sat, 27 September 2008 at 9:24 AM

When I was in school with computer science we were not allowed to refer to the numbers generated by random number simulators as random numbers... only as the output from rnd seeds. The commonest method to get a "random value output" as I understood it then was to drop down in the middle of an arbitrary very long irrational number or number with a very large set of non repeating numerals and use those digits as a virtual random input... the shift along the number's numerals was determined by CPU clock and/or operation values... those values were used to select decilmals that were then represented as a decimal value between 0 and 1.



ockham ( ) posted Sat, 27 September 2008 at 11:23 AM · edited Sat, 27 September 2008 at 11:23 AM

You don't really need specialist hardware to get true "physical" random values.  Just
tune an FM radio off-channel so that it hisses, then connect the earphone jack to the
Line In jack on your computer's sound system and hit Record.  The values in the
resulting sound file will be genuine and non-repeatable random numbers, within
a limited range.

My python page
My ShareCG freebies


Helgard ( ) posted Sat, 27 September 2008 at 2:44 PM

Ockham, when I turn the radio to the off-channel, I hear voices.... they tell me to do things.... make Poser models.... I must obey....


Your specialist military, sci-fi, historical and real world site.


momodot ( ) posted Sat, 27 September 2008 at 3:44 PM · edited Sat, 27 September 2008 at 3:45 PM

I had a TRS-80... you got sounds for games by placing an AM radio near the machine and it could make blips and bleeps over the static. The graphics were done by display memory storage array blocks. First few machines I had were 4KB RAM with data storage on audio casetet tapes.



ockham ( ) posted Sat, 27 September 2008 at 11:28 PM

Ah, I remember that.   You could program loops of various lengths and
patterns to get sounds of various freqs and timbres.

My python page
My ShareCG freebies


pakled ( ) posted Mon, 29 September 2008 at 6:45 AM

they also use random numbers on Networks, to avoid signal collisions. If 2 signals collide, a random number is used to change the timing on one, so that they retry at different times (CSMA/CD...if'n I remember correctly...;) Probably dating myself, but how else would I get lucky?...;) j/k...;)

I wish I'd said that.. The Staircase Wit

anahl nathrak uth vas betude doth yel dyenvey..;)


nyguy ( ) posted Mon, 29 September 2008 at 10:48 AM

Pick a number from 1 to 100.

Wrong try again.

In theory a number cannot be randomly created by mechanical means, this includes computers.  I do remember reading someplace random numbers can only happen when man or machine is not involved.

Example: you have 10 different patches of Grass a square acre each - how many blades of grass will there be in any one acre? You can estimate but each acre will have a random number with in a certain number of your estimate.

Poserverse The New Home for NYGUY's Freebies


ockham ( ) posted Mon, 29 September 2008 at 11:21 AM

Random numbers certainly can't be picked by humans, because our sense of
what's random doesn't agree with the strict definition.   When you're
randomly picking from a small number of choices (eg Win and Lose)
you'll get long strings of one or the other.  Humans perceive this as a
meaningful "winning streak" or "losing streak".  We only feel a
sequence as random if it's fairly close to a periodic alternation.
(One for you, one for me....)

The mathematical method used by computers is not true random because
it's actually a repeating sequence.  If you wait long enough, the whole thing
will come around again.  Good random formulas give VERY long sequences,
so that you aren't likely to catch the rerun in your lifetime.

But the hissing of the radio, or the hissing produced by a Zener diode
(which is often used in "specialist hardware") is definitely true
randomness.  It will never come full circle and repeat the total pattern,
though you will find small segments of repetition. (streaks again)

My python page
My ShareCG freebies


LBT ( ) posted Mon, 29 September 2008 at 12:18 PM

If you could program a computer to simulate the action of one of those lottery machines that drops numbered ping-pong balls into a chute, wouldn't that be random?


ockham ( ) posted Mon, 29 September 2008 at 1:40 PM

The trouble is that no strictly mathematical process is known to be purely random.
In other words, nothing that a computer could be programmed to do -- without some
input from a real physical process -- is guaranteed random.

Some easy-to-calculate sequences do appear to be random as far as we
have taken them.  The digits of Pi would be an example.  But I don't think
there's any firm proof that the sequence won't start repeating at some point.

My python page
My ShareCG freebies


nyguy ( ) posted Mon, 29 September 2008 at 1:46 PM

Quote - If you could program a computer to simulate the action of one of those lottery machines that drops numbered ping-pong balls into a chute, wouldn't that be random?

No because the numbers they use are not infinite, they are fixed so the computer is told pick number between 1 through number(x)  with a condition that it cannot pick the same number twice with in that series.

Even the machine that drops the ping pong balls does so not randomly due to it has only a finite numbers to pick from.

Poserverse The New Home for NYGUY's Freebies


LBT ( ) posted Mon, 29 September 2008 at 2:21 PM

I'm not sure why randomness requires an infinite number of possible outcomes.  The leaves that fall from a tree in Autumn do so randomly, but there is a finite number of leaves.


nruddock ( ) posted Mon, 29 September 2008 at 3:22 PM

Quote - Even the machine that drops the ping pong balls does so not randomly due to it has only a finite numbers to pick from.

The randomness in lottery machines comes from a whole barrel load of (what are essentially) chaotic effects.

To truely reproduce even a single draw you'd need to account for local changes in air density, air currents, tiny variations of gravity, atomistic scale flaws on all the surfaces of the machine, the balls etc.
The problem is of course you can't because attempting to measure some of these will be in the realm of the Heisenburg's Uncertainty Principle.

So while you could simulate a draw, you'll never be able to do so in a predictive way.


kuroyume0161 ( ) posted Mon, 29 September 2008 at 3:59 PM

Although probability is involved in the description of 'random numbers', nowhere does it define a necessity for infinite anything.  Also, randomness has nothing to do with repetition.  A sequence of events can be repetitive while exhibiting randomness.  It is really about the probability distribution.

For instance, you can roll a pair of dice a million times and show random behavior statistically - but there may be 'runs' within the sequence where the dice have the same faces.  And that doesn't even consider that the same faces must show up many times during the rolling sequence since the number of possible faces is less that the number of rolls.  In other words, randomness is closely aligned with indeterminancy or predictability.  The less predictable, the more random.

In mathematics, predictability is determined by being able to specify a pattern in the form of equations that provide deterministic answers.  The randomness of a sequence of numbers is determined by statistical tests because it would be impossible to test a sequence on every possible mathematical equation - the pattern is too complex.

Creating 'random' sequences of numbers is another story.  Now the question is this: how do you create a 'truly' random number sequence using mathematical formulas (on a computer)?  Random number sequences need to be unmodelable, as it were.  An equation, no matter how complex, will always have a level of predictability.  This is why programmers use radio noise and other external 'randomized' inputs to make the sequence more apparently random.

http://en.wikipedia.org/wiki/Randomness

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


LBT ( ) posted Mon, 29 September 2008 at 4:29 PM

Quote - The randomness in lottery machines comes from a whole barrel load of (what are essentially) chaotic effects.

To truely reproduce even a single draw you'd need to account for local changes in air density, air currents, tiny variations of gravity, atomistic scale flaws on all the surfaces of the machine, the balls etc.
The problem is of course you can't because attempting to measure some of these will be in the realm of the Heisenburg's Uncertainty Principle.

So while you could simulate a draw, you'll never be able to do so in a predictive way.

I'm sure you're right, and I wasn't suggesting that this would be a practical way to generate random numbers.  I was thinking that maybe the best way to compute randomness would be by trying to simulate the way it occurs in the real world, rather than through calculations that creates a set of differences for their own sake.


kuroyume0161 ( ) posted Mon, 29 September 2008 at 4:49 PM

Chaos Theory itself was launched by the random results of supposedly 'repeatable' atmospheric simulations on a computer (MIT meteorologist Lorenz).  But the problem is that chaos isn't particularly random.  The definition goes: random, chaos, order.  Chaos is inherently random-like but has understandable features which can be modeled (non-linear mathematics, state-spaces, and so on).  Thus is it a state inbetween random and ordered.

The problem with using such simulations (including lottery machines) is the amount of work needed.  Random numbers, for the most part, can't be predetermined and saved in an awaiting array - even if they are truly random.  Usually the demand is continuous and real-time.  As noted in "Numerical Recipes", the ideal situation is two separate computers - one generating random numbers while the other receives them for use in deterministic programs.

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.