Hello,
I have a bit of programming dilemma which I cannot seem to solve my self.
What if I have an array of numbers and I want to randomly select entry from the array so that the higher the number in the array the more likely it gets picked?
For example array like this:
[1000,800,400,200]
Should have highest change of selecting the highest number (1000) and lowest change for the lowest number.
How to calculate this?
thanks!
↧