Generaterandom numbers with equal probability

Dear all,

I wanna to generate numbers -in range- with equal probability.

So I have minimum value and maximum value and number of generate numbers and return array of numbers, like this:

Code:

`public long[] doGenerate(int min, int max, int total)`

{

return ret[];

}

Thank you.

Re: Generaterandom numbers with equal probability

Quote:

Originally Posted by

**shakatreh**
I wanna to generate numbers -in range- with equal probability.

So I have minimum value and maximum value and number of generate numbers and return array of numbers, like this:

Use the Random class. Search the net for info on usage.