Re: rand vs. random
- From: Schraalhans Keukenmeester <bitbucket@xxxxxxxxxxxx>
- Date: Sun, 24 Sep 2006 11:38:39 +0200
Amadeus W. M. wrote:
What exactly is the difference between rand() and random() ?For any serious statistical work and/or large series Monte Carlo
experiments you may want to abandon both in favour of a better algoritm,
such as the mersenne twister. You are free to use it , get the source at
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
/dev/urandom should be able to provide a fair initial seed.
Using the /dev/urandom stream as a direct source quickly exhausts the
available random data and not-so random data will be supplied instead,
without warning if I am correct.
If you need true random there are better solutions, but these may cost
you a lot. Either in money or time to build them, or both.
Popular random-generators have been created using lavalamps, radioactive
cores of smoke-detectors (low radiation, but still, be careful, it's not
intended to be taken apart.), all kinds of electronical circuits
producing random 'noise', webcams in completely darkened 'jars',
soundcard static or white noise, Geigercounters (there are simple
serial/usb versions on the market).
Fun to experiment with, but not per se always random and/or
equidistributed, let alone fast. Google should be your friend in case
you want to read more on the subject. There are thorough test kits
available (software) that can do almost any conceivable test on your
random data. Again, Google.
HTH
Sh.
.
- Follow-Ups:
- Re: rand vs. random
- From: Lee Sau Dan
- Re: rand vs. random
- From: Unruh
- Re: rand vs. random
- From: Jean-David Beyer
- Re: rand vs. random
- References:
- rand vs. random
- From: Amadeus W. M.
- rand vs. random
- Prev by Date: Re: Dual-boot install on PC with XP recovery partition
- Next by Date: Re: Vim on really old Laptop (Slackware)
- Previous by thread: Re: rand vs. random
- Next by thread: Re: rand vs. random
- Index(es):
Relevant Pages
|