Random Number Generator?

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

Random Number Generator?

Postby Slater » Sun Aug 07, 2005 1:01 pm

I find random number generation useful often... only problem is that I hate having to use my TI-83 to generate them. So my question... are there any good RNG programs out there?
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby Syaoran » Sun Aug 07, 2005 1:32 pm

Yes your head....I am not kidding...you can randomly pick nummbers faster then any progam out here.
User avatar
Syaoran
 
Posts: 1002
Joined: Thu Jan 13, 2005 7:41 am

Postby Slater » Sun Aug 07, 2005 1:40 pm

yeah, but I prefer an external source
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby Technomancer » Sun Aug 07, 2005 3:29 pm

It depends on what you're doing, and what you plan to be working with, and what kind of probability distribution you need. The C-function rand for example works fine, but only gives you a uniform distribution. GNU Scientific Library (more C) also has a number of different random number generators, which seem to work well enough and also covers a number of different distributions (e.g. Gaussian, Cauchy, etc, etc). I believe the book 'Numerical Recipes in C' also covers some of the programming aspects.

The basic RNG's in MATLAB only cover uniform, Gaussian and Poisson distributions, but again you should be able to program other pdfs with a little bit of work. MATLAB is easy to use, but personally I'm not very satisfied with their RNG, since it outputs the same results in sequence each time you load the program.

Another alternative is to simply look in books of scientific/engineering tables, which frequently have tables of random numbers generated according to some distributions. While they can be convenient at times, these books are also fairly hard to find these days owing to the appearance of digital computers.
The scientific method," Thomas Henry Huxley once wrote, "is nothing but the normal working of the human mind." That is to say, when the mind is working; that is to say further, when it is engaged in corrrecting its mistakes. Taking this point of view, we may conclude that science is not physics, biology, or chemistry—is not even a "subject"—but a moral imperative drawn from a larger narrative whose purpose is to give perspective, balance, and humility to learning.

Neil Postman
(The End of Education)

Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that my ignorance is just as good as your knowledge

Isaac Aasimov
User avatar
Technomancer
 
Posts: 2379
Joined: Fri Jun 13, 2003 11:47 am
Location: Tralfamadore

Postby shooraijin » Sun Aug 07, 2005 3:45 pm

And then there's PGP (and gpg)'s RNG, which seeds itself off entropy from you banging keys at random (both the keys and the interval between keypresses at high resolution).
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Slater » Sun Aug 07, 2005 3:54 pm

thanx guys, I'll try to find those and test them out. The PGP one sounds very kewl...
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby shooraijin » Sun Aug 07, 2005 3:56 pm

It's in the source for the key generator. Pretty easy to understand.
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Syaoran » Sun Aug 07, 2005 4:06 pm

Do you know about this little chart.

(1)

(1)(1)

(1)(2)(1)

(1)(3)(3)(1)

(1)(4)(6)(4)(1)

(1)(5)(10)(10)(5)(1)

and so on

It helps for when you use CnR

Why use a machiane when you can use your head.
But you don't have to lessin to me.....I am just puting my 2 cents in.
User avatar
Syaoran
 
Posts: 1002
Joined: Thu Jan 13, 2005 7:41 am

Postby Slater » Sun Aug 07, 2005 6:30 pm

that chart's called a pascal triangle... hmm... come to think of it, I was wondering if there's a PT generator out there either... helpful with math.
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby Shadowchild » Sun Aug 07, 2005 6:37 pm

ha ha I have a TI84 lol. dude you are so last year.
[color=indigo]ADOPTED BY:Nami, CephasVII, spectroking, Starfire1
ADOPTED: teen4truth, spirit-me-away, ky kiske, Sage_AlKahira, dragon's bane, phinny5608, mastersquirrel, LeaChan-4ever, Dytae, Tom Dincht, Jack Bond, Mega, meg, Celestra, JadeFox
PET AND GRANDDAUGHTER OF: Banana-chan
SISTER OF: girl ninja, Starfire1, and rusty789, Batosai [/color]


I'm looking for someone to quench my thirst - for all eternity.
User avatar
Shadowchild
 
Posts: 756
Joined: Mon Jul 04, 2005 8:02 am

Postby Technomancer » Sun Aug 07, 2005 9:57 pm

Syaoran wrote:Why use a machiane when you can use your head.
But you don't have to lessin to me.....I am just puting my 2 cents in.


Well, if you can pull numbers from a Cauchy or Laplacian distribution out of your head... Realistically though, most numbers that you pull from your head aren't really that random, and tend to follow a distribution that may be less than useful. If you need lots of numbers or numbers pulled from a particular kind of probability distribution you really don't have much of choice but to use some kind of RNG.
The scientific method," Thomas Henry Huxley once wrote, "is nothing but the normal working of the human mind." That is to say, when the mind is working; that is to say further, when it is engaged in corrrecting its mistakes. Taking this point of view, we may conclude that science is not physics, biology, or chemistry—is not even a "subject"—but a moral imperative drawn from a larger narrative whose purpose is to give perspective, balance, and humility to learning.

Neil Postman
(The End of Education)

Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that my ignorance is just as good as your knowledge

Isaac Aasimov
User avatar
Technomancer
 
Posts: 2379
Joined: Fri Jun 13, 2003 11:47 am
Location: Tralfamadore

Postby Slater » Sun Aug 07, 2005 11:36 pm

I'm currently using SuperCool RNG. It's... well, super cool. You can let it chose a random seed which it uses to chose random numbers within a specified range, or you can chose the seed yourself. Also has a random name generator, so I don't have to bust my head thinking of new names for minor characters when I roleplay :D
Image
User avatar
Slater
 
Posts: 2671
Joined: Sat May 22, 2004 10:00 am
Location: Pacifica, Caliphornia

Postby Technomancer » Mon Aug 08, 2005 5:08 am

Out of curiosity, what are you using it for? My own line of work (signal processing) depends pretty heavily on having a good RNG for testing and simulation purposes.
The scientific method," Thomas Henry Huxley once wrote, "is nothing but the normal working of the human mind." That is to say, when the mind is working; that is to say further, when it is engaged in corrrecting its mistakes. Taking this point of view, we may conclude that science is not physics, biology, or chemistry—is not even a "subject"—but a moral imperative drawn from a larger narrative whose purpose is to give perspective, balance, and humility to learning.

Neil Postman
(The End of Education)

Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that my ignorance is just as good as your knowledge

Isaac Aasimov
User avatar
Technomancer
 
Posts: 2379
Joined: Fri Jun 13, 2003 11:47 am
Location: Tralfamadore


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 123 guests