I am looking for a random number generator that can be biased. For instance, say I want a random number between 1-5, with the probability being:
1: Comes up 20% of t
Throw a random real number x in [0,1], if 0< x<0.2 return 1, if 0.2, etc.
if 0< x<0.2 return 1
if 0.2, etc.
See here for the general problem.