|
|
View Full Version : Random Numbers
spacemanspiff 03-13-03, 07:20 PM I was using this random number generator on my computer and someone told me that it "wasn't really random". I assume that means that there is some pattern to the numbers it gives you, however sligt this pattern may be it's "nearly random".
My question is, given enough generated numbers wouldn't you be able to discern some sort of partern from any random number generator.
Is there a purely random number generator or is the idea of randomness more theoretical and difficult to actually atain.
your friend is right. the random number generator of a computer is not truly random. if you analyzed the data enough, you could discern some pattern.
computer scientests try long and hard to find algorithms which make the random number generator as random as possible though, so it is very very difficult to notice the nonrandomness of it.
as to your question of whether a truly random source of numbers can really be made, the answer is probably yes. according to the modern interpretations of quantum mechanics, certain quantum events are truly random, in a way that the best computer random number generator is not.
if you knew the algorithm of the computer (which you could probably find in the specs of the machine somewhere), you could predict its values. but you can never predict with certainty the outcome of certain quantum events, like, say, the decay of a uranium nucleus, or many other events.
in principle you could rig up your computer so that it generated random numbers based on quantum events.
perhaps you have heard of quantum computers? this is what they are, although in that case, the goal is not to seek better random number generators, but a quantum computer is a computer that relies on quantum fluctuations, rather than deterministic electronic circuit flows, which can never have inherent randomness.
Prosoothus 03-13-03, 07:26 PM spacemanspiff,
I honestly believe that true randomness doesn't exist. Therefore, it would be impossible to make a truly random number generator.
However, if you make a computer program that uses the temperature of the CPU as a seed for a random number generator, then you won't be able to discern a pattern from the numbers generated (because the pattern would be too complex).
Tom
I was reading an academic paper (don't remember where...wish i had a better memory) about a software implementation to improve the randomness of pseudo-random number generators in *nix systems. They use conventional pseudo-random number generators which are pretty good anyway and seed them not with time, but with a number generated by something within the OS itself...it was the task scheduler or something like that. But the effect was that the pseduo-random number generator never patterened because it was seeded with random numbers.
-AntonK
James R 03-13-03, 10:40 PM I think that many computers use the CPU clock to generate pseudorandom numbers. The actual random numbers are usually generated by taking the remainder after division by a large number.
snakeyez 03-13-03, 11:23 PM Maybe this will help.....
There are two ways that computers can generate random numbers:
You can create some sort of device that monitors a completely random natural event and sends its results to the computer. For example, you could place a piece of radioactive material in front of a Geiger counter and connect the Geiger counter to a computer. Since radioactive decay is random, the Geiger counter would create truly random numbers. This approach is pretty rare, because not many people have Geiger counters connected to their machines.
You can create a formula that generates a pseudo-random number. When designing the formula, the idea is for it to produce a string of numbers that would look random to anyone who did not know what the formula is. Characteristics of a good formula include:
No repetition: The sequence does not cycle around and repeat itself.
Good numeric distribution: If the formula is producing random numbers between 0 and 9, the number of zeros, ones, twos, etc. that it produces should be roughly equal over a long period of time.
Lack of predictability: You have no way to predict what the next number will be unless you know the formula and the seed (the initial value).
Here's an example of a simple random-number formula from the book "The C Programming Language," by Kernighan and Ritchie:
int rand()
{
random_seed = random_seed * 1103515245 +12345;
return (unsigned int)(random_seed / 65536) % 32768;
}
[See How C Programming Works for more information on the C programming language.]
This formula assumes the existence of a variable called random_seed, which is initially set to some number. The random_seed variable is multiplied by 1,103,515,245 and then 12,345 gets added to the product; random_seed is then replaced by this new value. This is actually a pretty good pseudo-random number generator. It has a good distribution and it is non-repeating. If you use it to produce random numbers between 0 and 9, here are the first 20 values that it produces if the seed is 10:
4
4
6
0
7
4
2
3
5
0
5
6
6
4
5
6
7
6
7
4
If you have it produce 10,000 values between 0 and 9, here's the distribution:
0 - 1015
1 - 1024
2 - 1048
3 - 996
4 - 988
5 - 1001
6 - 996
7 - 1006
8 - 965
9 - 961
Any pseudo-random number formula depends on the seed value to start the sequence. If you start with the same seed, you will get the same sequence of values from the formula. So if you give the rand() function shown above the seed of 10 on one computer and look at the stream of numbers it produces, it will be identical to the stream of numbers produced on any computer that runs it with a seed of 10. In the case of the Global Positioning System, this reproducibility is used as a way to give each satellite a predictable but different pattern of values that the GPS receiver can track.
To create a random and unpredictable sequence, the seed must be a truly random number. To get this truly random number for the seed, most programs use the current date and time, converted to an integer value (for example, converted to the number of seconds that have elapsed since January 1, 1970). Since this is a different number every time you start the program, it makes a good seed.
http://computer.howstuffworks.com/question697.htm
malisha 03-14-03, 12:14 AM there is an entropy pool which some random generators use. in the entropy pool things like mouse clicks, cpu cycles and many different types of events are recorded and a number is generated, this number can then be used as the seed.
Yes this isnt trully random because you could duplicated the events that go into the entropy pool, but it would be might hard to do some of them again.
one_raven 03-14-03, 12:22 AM If you were to use something like an algorithm utilizing the current temperature in Guam, the number of seconds that have elapsed since the computer was turned on, the number of bytes that have been transferred to and from your NIC today and the current barometric pressure in Seattle, Wa...
Would it then be considered truly random?
Is the roll of a die considered truly random?
malisha 03-14-03, 12:29 AM no they arnt because there are known steps used to get to that number no matter how small the steps maybe, is you could do these steps again then apply the algorithm you can get that number again, its just some of these events are so hard to duplicate .. for all intensive purposes u can classify the number that is generated as random
Truly random means having no (traceable) past. Because the future has no traceable past the future is truly random (before it happens).
In my opinion true randomness cannot exist.
for a generator such as the one suggested by snake eyz works well. But the seed would also have to be random for it to be truly random. Therefore another generator would have to be used, and so on so forth. The more generators the more random however we would never reach randomness. So only an infinite number of generators supplying seeds to the next would cause true randomness. So its theoretical. For practical purposes tho, even 1 or two would suffice.
Just thinking or am I talking balderdash. lol
Any time you have a problem that is not solvable and causes back and forth aurguments, you can almost bet there is a hidden adjective that is trying to be defined. Notice that random must have a noun after it to make random numbers. Random by itself has no meaning. (Same thing with intellegence which is an abstract noun. Why AI does not work.)
Abstract means you cannot make a model of it.
The random numbers that a computer makes are chaos, which is digit rollover and does not produce random numbers.
Random cannot be defined.
Notice that random must have a noun after it to make random numbers.
I liked that point. Looking at the dictionary (which I really do), I see that the word random is only an adj. which suggests that random by itself means nothing. We can only say that something has a certain amount of randomness.
Randum Numbers as I undestand is defined as: A assigned real number between two limits that has an equal chance of being any real number between those two points.
Dunno how that helped but I thought I'd give a english look into it.
It seems that true randomness is only theoretical as I said before.
Fluidity 03-14-03, 04:43 PM Within the framework of a 3-dimensional computer rendered envioronment, construct a 10 sided die with a perfectly elastic weightless ball inside it. As a function of time and the velocity of the ball, the sides of the die change size and proportion to the other sides, causing a change in the angles of reflection for the bouncing ball within. The die bounces with a perfectly elastic collision, weightless in a sphere with a fractal landscape interior that is constantly changing as a function of the velocity of the ball and time. Each time the ball within the die strikes a surface, it is representative of a number 0-9. Also, each time the ball strikes a surface in the die, the surface is reordered as a function of time and distance from the epicenter of the sphere that contains the die.
This could be done relatively easily in OpenGL. The program would run quickly if the rendered detail was kept low enough.
Would this generate an almost perfectly random sequence?
It seems that the eternal problem is the seed, or first number. I'm not sure I quite grasp fluiditys opengl idea, (it sounds great by the way), mathematically which is what we are all interested in, a random number formula or function must have an input and that too must be random. Would your idea, fluidity give you a random seed?
Fluidity 03-14-03, 05:29 PM Because, the sequence is always running. If you want a sequence of 12 random numbers for example, you hit enter and it begins recording the sequence, which is continually being generated. You have to start from somewhere, but once it has begun, you can tap into it any time. Each beginning sequence would be completely different if we take year, day, hour, and minute into account for the function of time to determine the geometry of the die.
Fluidity 03-14-03, 05:29 PM Because, the sequence is always running. If you want a sequence of 12 random numbers for example, you hit enter and it begins recording the sequence, which is continually being generated. You have to start from somewhere, but once it has begun, you can tap into it any time. Each beginning sequence would be completely different if we take year, day, hour, and minute into account for the function of time to determine the geometry of the die.
Here is how to make a fool proof random number.
Take the number 3. Say "That is a random number".
There you are.
That was a pointless post.
-AntonK
Bebelina 03-15-03, 07:48 PM This is very interesting, how does one measure randomness, and if it can be measured is it still considered random?
Kind of seems to get philosophical. If there is a definate (known or unknown) set of rules governing the universe. Then every particle has had its path set since the big bang. In which case there really isn't anything random since everything boils down to an incredibly complex and HUGE HUGE equation derived from those laws of physics.
-AntonK
Bebelina 03-15-03, 08:05 PM Either everything is in order, or nothing is. The universe must be cosequent, don't you think?
Which side have we seen most proof of up until now then?
Or has each presented an equal amount of evidence, which leaves us with another paradox.
Or does it? Can there be a shared universe with both chaos and order?
Hmm good questions ~~racks his brain some~~
I would have to say it may not be a paradox to have a universe that exists with both order and chaos. I'm not saying that is how it is, but it seems to me to be possible that a universe be governed by not rigid rules that we use such as a = F/m , V = dx/dt , etc but more by probability at a small scale. If the probabilities of events happening are large enough, we would see it (from a macro scale) as set mathemetical laws. And we should see them this way, theres no need to do more work to get an answer different by the 1.0 x 10^-100 decimal place. BUT...if this is true then it means its possible for the universe to exist such that not all probabilities are that hight and some may be random (with a set probability, but random none the less).
This is of course all hypothetical and philoscientifical (my made up word) but those are my thoughts.
-AntonK
PS - don't think Ive had the pleasure of having a conversation with you Bebelina..nice to meet you.
Bebelina 03-15-03, 08:29 PM Nice to meet you too AntonK.
Sometimes I seem to get a random flush of hightened intelligence, but now the moment seems to have passed. :p
Because it was very hard for me to follow your reasoning there, I also know basically nothing about mathematical formulas and such.
But if there is chaos within order, is that really chaos? Wouldn't that be ordered chaos, and as such not chaos att all but order? Does randomness then decide what is chaos and what is order?
Is order random?
I lost myself there...
blobrana 03-16-03, 04:26 AM Like onion skins...?
Um, just going back to randomness (not including the universe), correct me if i'm wrong. But if we generated n random integers then to know if its perfectly random then the amount of times 1 comes up would be the same amount of times 2 comes up and the same amount of times 3 comes up etc. Would it then be perfectly random. Obviously if only a few numbers were generated then it wouldn't be but say 1000 000 or so. Seems the more accurate my assumption is the more random the numbers are.
Am I talking shi!? just thinking
Prosoothus 03-18-03, 03:53 PM SciBoy,
But if we generated n random integers then to know if its perfectly random then the amount of times 1 comes up would be the same amount of times 2 comes up and the same amount of times 3 comes up etc.
Each integer will come up at the same rate as any other integer as long as you generate an integer an infinite amount of times, and as long as each integer has an equal probability of coming up. This rule applies regardless of whether the algorithm is random, or not.
Tom
A random number is still whatever you say it is.
Random itself has no definition.
Originally posted by SciBoy
... if we generated n random integers then to know if its perfectly random then the amount of times 1 comes up would be the same amount of times 2 comes up and the same amount of times 3 comes up etc.
Setup
C is a set of natural numbers {1,2,3,...,b}; this could just be 1-10 to represent digits if you so choose.
n = b*k, such that k is a natural number
So when we generate n random numbers, each number, 1 through b, would be chosen k times. This is not randomness.
So let k = 1 and lets try it. So this supposedly means that each number should be chosen exactly once. For our first random number, let us choose a. to not choose it again, we must remove it from the set, so now our domain set C = {1,2,3,...,a-2,a-1,a+1,a+2,...,b}
When the n-1 random number is chosen, and it is removed, the cardinality of your set would be one (let's call the number z), and the last "random" number would have to be z. Only having one choice, inhibits randomness.
Furthermore:
Tell me the limitations of your random generating machine, and I'll tell you why it isn't random. For most calculators, usually a decimal number to 3 places between 0 and 1 is chosen. How truely random is that? I could say that your random number generator won't output .03871 and if we were to place bets, I'd win.
The probability of choosing any number from that set of decimal numbers to 3 places is only 1 out of 1000. Just how many numbers are there between 0 and 1? By cantor's diagnalization....uncountably many. And you want to limit your set down to only 1000 numbers? That's not very random.
Originally posted by hlreed
A random number is still whatever you say it is.
Random itself has no definition.
This seems like a rather awful oxymoron to me. How can you define something that has no definition?
Originally posted in huge red letters by Bebelina
Either everything is in order, or nothing is. The universe must be cosequent, don't you think?
Which side have we seen most proof of up until now then?
Many things about the world are deterministic, but not all. Some quantum events are inherently non-deterministic and purely random.
everneo 03-19-03, 12:50 AM Originally posted by a very
This seems like a rather awful oxymoron to me. How can you define something that has no definition?
'undefineable' is description not definition..! btw if u define something that means u r sure about it. if r sure then randomness is gone.:) how to cool the fire..?!!!
synergy 03-19-03, 10:50 AM Bebelina,
It would be possible for macroscopic objects to seem predictable while subatomic particles have random characteristics. In fact, that is how quantum physics describes the universe. All of the little random particles balance out to present the appearence that the macroscopic objects they are part of are predictable, but in theory your position right now is a random event, but only if we could measure that position on the order of 10 to the minus 23rd power centimeters. With meter sticks, your position seems perfectly defined, but only because all of the little particles that make you balance out their uncertainties through the forces that hold them together.
Aaron
Prosoothus 03-19-03, 01:09 PM synergy,
With meter sticks, your position seems perfectly defined, but only because all of the little particles that make you balance out their uncertainties through the forces that hold them together.
How do you balance out uncertainties? Can you take multiple random algorithms and combine them to produce a deterministic algorithm? I don't see how one random event can cancel out, or balance, another random event.
Tom
synergy 03-19-03, 03:06 PM Here is a simple example:
you have a room with 2 octopus armies armed with basketball-sized balls of clay. At a prearranged signal, both armies start throwing. Although the trajectories are mostly random, after the armies run out of ammo, inspection of the room will reveal a disproportionate number of clay lumps in the exact middle between the two armies (where opposing lumps collided). Granted, this is a weird example, but randomness CAN lead to large-scale order. A more physics-oriented example is the two-slit experiment. The exact position of each photon when it hits the screen is random, but overall there is a pattern that develops according to a probability distribution.
Prosoothus 03-19-03, 03:29 PM synergy,
you have a room with 2 octopus armies armed with basketball-sized balls of clay.....
LOL!!!:p
Anyway, the reason that more lumps of clay appear in the middle is because the direction of the motion of the clay balls are not completely random (for example, an octupus won't throw the clay ball behind him/her). If the direction of the clay balls was truly random, then there wouldn't be a greater probability of the clay being in the middle of the room.
However, I do see your point. A random event can be restricted to a limited area by the four fundamental interactions. Everything within this area would be random, but everything outside of this are would be deterministic. Nevertheless, I still don't believe that true randomness is possible. :)
Tom
My example isn't nearly as interesting as the octopus army, but here's another way to look at it. Imagine you had dice that would randomly produce a number from 1 to 6 when rolled. You also have a big pile of bricks. You start making six stacks of bricks with each face of the dice having its own stack. Every time you roll a 4 you put a brick in the number 4 stack, etc. If you roll the dice 20 times your stacks will probably be very uneven; some will have many bricks, some will have only a few. The shape of your 'brick scape' will be pretty random. If you were to roll the dice a thousand times, your stacks would be much more uniform. They would all be about the same height with only small variations at the top. If you were to roll and stack for so long that your brick stacks were visible from a mile away, a person observing from a distance of one mile would probably think that the stacks were all the same height, even though there are small random differences in the exact height of each pile. Although the stack onto which each brick is placed is random, the overall shape of the stacks is not random; the laws of statistics cause the stacks to converge to the same relative heights as more and more bricks are added.
This is analogous to the way we view macroscale objects. The exact position of any one particle is random, but statistics cause the overall apparent position of an object to 'average out' in the same way that they cause the height ratios of your brick stacks to average out.
Hope that helps.
orthogonal 03-20-03, 11:20 PM Bebelina wrote:
... how does one measure randomness, and if it can be measured is it still considered random?
I like Gregory Chaitin's definition of randomness:
"A series of numbers is random if the smallest algorithm capable of specifying it to a computer has about the same number of bits of information as the series itself."
http://www.cs.auckland.ac.nz/CDMTCS/chaitin/sciamer.html
Tor Norretranders wrote:
"We cannot propose a general rule that tells us how to figure out whether a number is random or not - whether it can be expressed more concisely or not. This is a direct consequence of Goedel's realization."
C.P. Snow wrote of a famous conversation between Srinivasa Ramanujan and G.H Hardy:
"Hardy used to visit him, as he lay dying in hospital at Putney. It was on one of those visits that there happened the incident of the taxicab number. Hardy had gone out to Putney by taxi, as usual his chosen method of conveyance. He went into the room where Ramanujan was lying. Hardy, always inept about introducing a conversation, said, probably without a greeting, and certainly as his first remark: 'I thought the number of my taxicab was 1729. It seemed to me rather a dull number.' To which Ramanujan replied: 'No, Hardy! No, Hardy! It is a very interesting number. It is the smallest number expressible as the sum of two cubes in two different ways."
In other words, the fact that we can't discover order does not prove that order is not there. We can never prove that a number is random; we can only falsify the fact that it is random. Rudy Rucker said:
"A real number is random if it contains an irreducibly infinite amount of information."
Since I don't believe infinities exist, I don't believe that a number could contain an infinite amount of information, ergo...randomness does not exist.
Michael
Originally posted by orthogonal
...Since I don't believe infinities exist, I don't believe that a number could contain an infinite amount of information, ergo...randomness does not exist.
Michael
There were people who didn't beleive the Earth was round. There were people who didn't beleive that the Earth revolved around the sun. There were people who didn't believe that the Moon wasn't made of cheese. Ergo.. nothing....
Just because someone doesn't beleive something, doesn't mean that it is not true.
However, soas not to be a hypocrite, I am not trying to change your opinion, merely, to inform you of what I have learned, in hopes that you may be able to add it to your collection of knowledge.
|