Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

random number from a normal/lognormal distribution  RSS feed

 
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
 
Skool. Stay in. Smartness. Tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!