Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

random number from a normal/lognormal distribution

 
Tim Cao
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the nextGaussian method in the Random class of java.util.
 
Tim Cao
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks marc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic