The term you are looking for is Weighted Random Numbers
, most of the algorithms I have seen use trig functions, but I think I figured out a way that will be efficient.
Create a table/array/List(whatever) that holds a multiplier value for the random function. Fill it out by hand or programatically
randMulti= {.1,.1,.1,.1,.1,.1,.2,.2,.3,.3,.9,1,1,1,}
then Multiply random
by a randomly chosen randMulti
and finally by the max Value of the distrobution
weightedRandom = math.random()*randMulti[Math.random(randMulti.length)]*maxValue
I do believe that this will be much faster than using sqrt, or other more computational complex functions, and will allow for more custom grouping patterns.