Weighted random function. Should be used with lists smaller than 100. Passed that is not efficient.