View Single Post
Old 12-16-2011   #1
mr_j
Community Moderator
 
mr_j's Avatar
 
Last Online: 07-31-2023
Join Date: Oct 2007
Posts: 2,520
Thanks: 3,023
Thanked 2,076 Times in 1,156 Posts
Groans: 7
Groaned at 34 Times in 27 Posts
Default random numbers in java?

I need to generate random numbers in java, and I need them to be completely evenly distributed(or close to that) specifically I need to generate around 300 numbers between 1 and 100...

math random method is not helping, nor any other traditional random method. the problem is the numbers I get from those methods repeat themselves after a certain time, or that they are not evenly distributed(so I get more than half the numbers below 50 and less than half above it...)

any ideas?
__________________
"Loyalty to the country always. Loyalty to the government when it deserves it. "
-Mark Twain

Last edited by mr_j; 12-16-2011 at 08:40 PM.
mr_j is offline   Reply With Quote