ok, so... I'm trying to make a function (in python, but will be converted to js later) that picks a "random" number, but it needs to be weighted
the arguments should be a minimum, maximum, number to be biased towards, and the magnitude with which it should be biased (that still needs some defining)
I've found a lot of examples but almost all of them use squares or square roots which force you to bias towards the top or bottom, and I want it to be variable
and now I have two ideas, mostly inspired by what other people have said:
create a list of numbers from the min to the max, then go back through it and add more numbers, depending on the bias arguments
like, with min=1 and max=5, biased towards 3, the end result list might be [1, 2, 2, 3, 3, 3, 4, 4, 5]
or the same min and max biased towards 1 might be [1, 1, 1, 2, 2, 3, 4, 5]
see what I mean? then I pick a random item from that list. the magnitude argument would determine how many of each number is added
also not sure how to determine how quickly the number of numbers added should drop off as it gets further from the number it should be biased towards. reducing by one for each number seems too slow
I thought I had another idea but actually no I don't. plz help