Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Answer: How do I get random numbers that follow standard distribution?

by tilly (Archbishop)
on Aug 09, 2000 at 02:57 UTC ( #26910=categorized answer: print w/replies, xml ) Need Help??

Q&A > math > How do I get random numbers that follow standard distribution? - Answer contributed by tilly

If you don't need a perfect normal distribution then you can get a very good approximation by choosing several random numbers and adding them together. You can then multiply then add by appropriate constants to get the desired average and variance.

For most purposes, adding a dozen is good enough.

If you want better than that, try installing Math::Random.

DISCLAIMER: I am one dissertation short of a PhD in math. (It is hand-written, needed an income so I never cleaned it up and typed it.) Therefore for all intents and purposes, I am a mathematician. :-)

  • Comment on Answer: How do I get random numbers that follow standard distribution?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-10-22 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (230 votes). Check out past polls.

    Notices?