Possible Duplicates:
Random weighted choice
Generate random numbers with a given (numerical) distribution
I have a list of list which contains a series on numbers and there associated probabilities.
prob_list = [[1, 0.5], [2, 0.25], [3, 0.05], [4, 0.01], [5, 0.09], [6, 0.1]]
for example in prob_list[0]
the number 1 has a probability of 0.5 associated with it. So you would expect 1 to show up 50% of the time.
How do I add weight to the numbers when I select them?
NOTE: the amount of numbers in the list can vary from 6 - 100
EDIT
In the list I have 6 numbers with their associated probabilities. I want to select two numbers based on their probability.
No number can be selected twice. If "2" is selected it can not be selected again.