View Full Version : random numbers
LordZpider
2002-11-09, 11:10 PM
anyone know how something that suppose to take commands and act on those commands, a computer, GENERATE a random numbers?
Adrenachrome
2002-11-09, 11:13 PM
HUH?!
tacoX
2002-11-09, 11:55 PM
Rephrase please =/
DKWicked
2002-11-10, 12:25 AM
Originally posted by LordZpider
anyone know how something that suppose to take commands and act on those commands, a computer, GENERATE a random numbers?
anyone know how something that is suppose to take commands and act on those commands, ie a computer, GENERATE a sequence of random numbers?
I think thats the idea
no, I dont know
Shpook
2002-11-10, 12:40 AM
i think he's asking how something with a set formula and set parameters can prduce something completely random. Well, to the best of my knowlege, its not completely random. there are set parameters(orguidlines i guess u could say) and them a value or figure is selected within those parameters. sort of like rolling a pair of dice, you can never go higher than 12 or lower than 2, but anything in between is random. in a way its still controlled though, because you have to tell yourself to roll the dice.
I hope that was a good analogy, and i hope i was correct and helped you out.
Randuin
2002-11-10, 01:37 AM
it's... RANDOMIZE!! yes random ness is good
LordZpider
2002-11-10, 11:48 AM
What i'm trying to say is simply, how do computers generate random numbers?
and i know there are set parameters. but for example, i tell me calculator de create random intergers, and it just start spitting out random numbers, no patterns... just RANDOM... where do these numbers come from?!
Rurouni Storm
2002-11-10, 08:43 PM
Originally posted by LordZpider
What i'm trying to say is simply, how do computers generate random numbers?
and i know there are set parameters. but for example, i tell me calculator de create random intergers, and it just start spitting out random numbers, no patterns... just RANDOM... where do these numbers come from?!
They actually come from a formula that's fed from a small clock. That way, the number doesn't stay the same and is random enough for your purposes.
LordZpider
2002-11-11, 12:23 AM
yea, can u be a bit more specific please
Rurouni Storm
2002-11-11, 09:16 AM
A long read (http://world.std.com/~franl/crypto/random-numbers.html)
The C++ command for generation (http://www.cplusplus.com/ref/cstdlib/rand.html)
I can't find the actual formulas these functions use as they are copyrighted and kept secret by their creators.
WetWired
2002-11-11, 11:27 AM
I assume there is a random number generator someplace in Linux, right? Happy hunting :p
LordZpider
2002-11-11, 11:30 AM
that says nothing, the command is telling C++ to generate a random number, but not actually calculating one.
let's say,
printf ("A number between 0 and 99: %d\n", rand()%100);
and the ouput is 46
where did that 46 come from? no one seems to understand my question. But i think i should have just left it alone after the small clock theory, cuz that's probably as accurate as it will get
WetWired
2002-11-11, 11:33 AM
IIRC Linux has a random number generator proccess that is accessed by other programs. Also, you can get open source standard libraries for at least the Linux platform, which should either include a random number generator, or a call to the afforementioned.
Adrenachrome
2002-11-11, 12:11 PM
I have a random number generator its my left and right hands!
573457123762827359 random as hell number!!!!!!
Jamesadin
2002-11-11, 12:13 PM
That works!
Hades-Knight
2002-11-11, 12:15 PM
hres mine
18648746894543454365438674863
BlueCube
2002-11-11, 01:06 PM
I know it's a process that has to be seeded... if you use the same seed number, you'll keep getting the same "random" numbers in a sequence. You're right, it's usually the number of seconds elapsed since midnight that's used as the seed number.
RANDOMIZE TIMER
WetWired
2002-11-11, 01:30 PM
Actually, it's the number of seconds since midnight or reset, whichever is more recent :p
LordZpider
2002-11-11, 02:59 PM
so what if u generate 2 random numbers at the same time?
Rurouni Storm
2002-11-11, 03:17 PM
They still won't be generated at the exact same time. A computer cannot do that. It still only processes a single 1 or 0 at a given time.
The time when it reaches the second number will be slightly different, probably enough to make it different. However, if you had two comps running simultaneously at the exact same time, you could get the same number.
User Name # 1
2002-11-11, 03:22 PM
the exact same number ?
so they are not really random...
Medieval Bob
2002-11-11, 03:27 PM
There could be a pattern for the random number madness. Something similar to this:
Computer takes pi and divides by 7 and 2/5. It then stores the third digit.
Then the computer takes the fourth digit of 7/23 (a non-repeating, non-terminating decimal).
Those two numbers multiplied together is the first digit of your random number.
Then a similar process is repeated for the second, third, etc. If the number generated was larger or smaller than your parameters, it would simply divide or multiply by 10, 100, 1000, etc. Or maybe it would divide or multiply by 49/23...
Again, this is only speculation.
The clock idea sounds feasable, but I see flaws. In Visual Basic (my only programming language that exceeds amateur) there is a function to generate random numbers. These random numbers are predetermined, but there is no pattern. I would assume they come from some fraction such as 7/23 (only much more complex) or some variation of pi. However, there is another function, that, when combined with the original, will randomize the random numbers. They will not be predetermined. By no means have I ever gotten the same numbers on different tests based upon time. Thus, I would have to assume that the random numbers are not based upon any clock.
vBulletin® v3.8.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.