How can I generate random floats between X and Y, that are un-equally distributed, so that it's more likely to generate numbers from a specific range, within X to Y?
I did search a lot of keywords to find something like this including: unequally distributed random numbers, or uneven noise distribution, or biased random floats, or weighted random numbers ...
All I could find is to randomly pick from a bag of finite list of values, weighted so that some values are more likely to be chosen, but I'm looking to choose from an infinite range of floats between X and Y.
Also I found a lot of articles about how to NOT generate biased random numbers, which is the opposite of what I want.
As an example of WHAT I'm trying to do with these numbers: If you draw black noise in a white square, each noise dot is in a random location within the square, if you generate enough dots, you'll have a almost black square. If you distribute the randomness with a higher probability in the middle of the square, you'll draw almost a soft black dot in the middle of the square. This is what I'm trying to generate.
So my questions are: - I'm sure these algorithms exist, how are they called? - maybe can anyone suggest a quick implementation, in any language? - how can you specify the weight of the bias? Eg: it's 2x more likely, or 5x more likely to generate numbers in a specific range? In my example with the dot, I believe if it's 5x more likely to get numbers in a range, the dot will be smaller and darker. - how can you specify the softness of the distribution? Eg: linear, longaritmic, quadratic. In my example with the dot, I believe it will make the dot softer, or harder.
Thank you in advance!
Aucun commentaire:
Enregistrer un commentaire