selecting a number with certain probability
807598Sep 23 2006 — edited Sep 24 2006Hi guys,
i've used the random number method is java and know that it outputs a random number with equal probability.
OK here's my question. i've got a set of numbers from 1 to N and I want to output ONE number in the set say r with probability r/N , how do I do that??
ex: the set is {1,100} and i want to pick 19 with a probability 19/100
Thanks in advance for any help provided!