This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes random number from a normal/lognormal distribution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "random number from a normal/lognormal distribution" Watch "random number from a normal/lognormal distribution" New topic
Author

random number from a normal/lognormal distribution

Tim Cao
Ranch Hand

Joined: Jul 26, 2004
Posts: 37
hi all,

Could anyone tell me how to generate a sequence of random numbers
drawn from a normal (or lognormal) distribution. All the random
generators in JFC are from uniform distribution. Do I need some
stat package for this?

Thanks for reading,

T.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

See the nextGaussian method in the Random class of java.util.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Tim Cao
Ranch Hand

Joined: Jul 26, 2004
Posts: 37
thanks marc
 
jQuery in Action, 2nd edition
 
subject: random number from a normal/lognormal distribution