Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

How do computers generate random numbers

Options
  • 26-01-2005 1:19am
    #1
    Closed Accounts Posts: 578 ✭✭✭


    Yeah.. so.. how do they do it?


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Wikipedia wrote:
    A computational random number generator is more accurately called a "pseudorandom" number generator, since the sequence is generated by a specific algorithm, which can be replicated exactly to yield an identical sequence. A numeric value, called a seed, is used in the algorithm to produce the random number. This seed is often based on the computer's local time at the moment the computer code is executed, thus reducing the probability of producing the same starting sequence twice.

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


  • Hosted Moderators Posts: 2,094 ✭✭✭halenger


    Another answer would be:

    They do it badly. ;) (Sorry we had a crypto project on generating a proper random number)

    There's many ways it can be done. Programming languages have it built in but they're just mathematical formulae, often quite predictaible or generally bad ones (I think rand in C is an appauling one, if my memory serves me).

    If you want true randomness buy a geiger counter and steal/acquire some nuclear material. Other than that? Random keyboard input + mouse movement coordinates + network traffic + as many other "random" sources as you can think of. Drop them into a SHA-cauldren and out comes a nice random number. :p

    Too much info? Hopefully! (joking)


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Well, yeah you could put it like that... But my way is more fun becuase its got big words and technobabble... :D


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    I read somewhere that the NSA and KGB used sensitive antennas to pick up the background microwave radiation from the big bang and generate one-time pads with it, I guess that's about as random as you can get.


  • Registered Users Posts: 950 ✭✭✭jessy


    white noise/static is completely random You need an antenna to pick it up. So called built in random number generators do not create random numbers.(no mathematical formula will give you a random number)


  • Advertisement
  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    stevenmu wrote:
    I read somewhere that the NSA and KGB used sensitive antennas to pick up the background microwave radiation from the big bang and generate one-time pads with it, I guess that's about as random as you can get.

    Tom Clancy had Jack Ryan implement this system (called TapDance in the books, I think) somewhere along that series of books....

    Ultimately, there is no way to generate a random number. At best, you can derive one from a random source (white noise, half-life decay, etc.

    jc


  • Registered Users Posts: 173 ✭✭happydude13


    Check out

    random.org


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    halenger wrote:
    (I think rand in C is an appauling one, if my memory serves me).
    The standard defines a function signature and that the result be a pseudorandom number in the range 0 to RAND_MAX and that this result can be seeded in a deterministic manner by a call to srand().
    Within those requirements an implementation of the standard library can provide a PRNG of cryptographic quality if the implementer wants (though this would be wasteful for some applications of rand() so it's probably not really a good idea).
    There is an example implementation given in the standard, and it is indeed rather poor, but fine for many uses.

    It's notable that in the C++ standard library the random_shuffle() function can be called with a reference to a random number generating function or function-object so that you can change the PRNG used should you have need for a greater degree of randomness.


  • Registered Users Posts: 2,932 ✭✭✭Sniipe


    my dog barks randomly at people...


  • Closed Accounts Posts: 89 ✭✭monster_fighter


    Interl Chipsets from the 810 onwards have built in hardware thermal noise detection RNG's.


  • Advertisement
  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,687 Mod ✭✭✭✭Capt'n Midnight


    Interl Chipsets from the 810 onwards have built in hardware thermal noise detection RNG's.
    That's how the CIA want you to think it works, wasn't clipper one of thier previous attempt to force people to use thier encryption chips :D

    The Rand corporation published a book of one million random digits, slight more useful than an atlas of finite groups.


  • Registered Users Posts: 1,766 ✭✭✭robbie1876


    wayfarer wrote:
    How do computers generate random numbers
    Comes from the female part of the computer. Can't get more random than that.


  • Registered Users Posts: 6,440 ✭✭✭jhegarty


    jessy wrote:
    white noise/static is completely random You need an antenna to pick it up. So called built in random number generators do not create random numbers.(no mathematical formula will give you a random number)


    i have seen methods that use an open source card (line in) to do it. There is always some bit for static , even without a microphone connected.....


Advertisement