The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. Non Life Sciences
  3. Geek Speak
  4. How does a computer generate a random number?
« previous next »
  • Print
Pages: [1]   Go Down

How does a computer generate a random number?

  • 3 Replies
  • 5125 Views
  • 0 Tags

0 Members and 1 Guest are viewing this topic.

Offline bizerl (OP)

  • Sr. Member
  • ****
  • 279
  • Activity:
    0%
How does a computer generate a random number?
« on: 15/02/2013 04:15:08 »
Or how does my ipod decide what order to play songs when I "shuffle"?

Is it truly "random" or is there always a pattern?
Logged
 



Offline CliffordK

  • Naked Science Forum King!
  • ******
  • 6596
  • Activity:
    0%
  • Thanked: 61 times
  • Site Moderator
Re: How does a computer generate a random number?
« Reply #1 on: 15/02/2013 06:31:21 »
Most computers will use some type of a pseudorandom number generator

The key is to get a "seed" such as the time of the clock that would be different, and not produce the same starting point every time the program is restarted.  Or, perhaps, remember the last number accessed in the sequence.

For an IPOD, a true random number may not be an issue.

There is a concern that games of chance with money involved, such of state lotteries could be compromised by poorly written pseudorandom number generators.
Logged
 

Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 11036
  • Activity:
    9.5%
  • Thanked: 1486 times
Re: How does a computer generate a random number?
« Reply #2 on: 15/02/2013 09:42:01 »
Humans are very good at seeing patterns where there is no pattern.

With the iPod, early versions selected the next song truly at random (in software) - but sometimes a truly random selection will play the same song twice in a row, or (even more likely) twice in the same hour. People complained, and so the song selection was made less random, by avoiding recently played songs, which perversely made people feel that it was more random! You can now select the degree of randomness that you want. http://electronics.howstuffworks.com/ipod-shuffle2.htm

There are severe limitations of software random number generators;  computer pioneer John von Neumann said that "Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin."

Intel is designing a hardware random number generator into new CPUs, which will make it effectively impossible to predict the next random number without hacking the computer. http://spectrum.ieee.org/computing/hardware/behind-intels-new-randomnumber-generator/0
« Last Edit: 15/02/2013 20:41:12 by evan_au »
Logged
 

Offline RD

  • Naked Science Forum GOD!
  • *******
  • 9094
  • Activity:
    0%
  • Thanked: 163 times
Re: How does a computer generate a random number?
« Reply #3 on: 15/02/2013 14:14:30 »
some computers use thermal noise to generate truly random numbers ...
http://en.wikipedia.org/wiki/Hardware_random_number_generator
Logged
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags:
 
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.419 seconds with 34 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.