Weighted random
From Wikipedia, the free encyclopedia
A random number is an abstract number that cannot and does not exist. In all cases of a number being called "random" there is a reasoning behind it, whether it is from the human brain or a computer program. When a random number on a computer is drawn, it is referred to as a programmer's random. Because it cannot actually be a random number there is a percent of occurrence for every number in the scope.
Weighting random numbers is impossible because the object created is not random. It is merely another percentage added to the equation. For instance, you have two objects and one has a rating of 9 and the other a rating of 2. The odds of 2 showing up are 7 times less than 9. This gives you a 22% chance of hitting 2. Now, if we added that into a random scope of say, 1-10 than the percentage of 2 hitting will change with each number given. However, be wary, because typically programmer's random tends to generate numbers in numerical order.