hey i'm trying to generate numbers from 1 to 3 in a way such that
number 1 has the probability 70% being generated
number 2 has the probability of 20% of being generated
number 3 has the probability of 10% of being generated
how do i do that?? can anyone please help.
Random r=new Random();
int i=1+r.nextInt(3);
this doesn't take into account the probabilities and generates the numbers in a random way..i need to generate the numbers according to their probabilites of being generated