Situation
I'm trying to formulate a formulae that given a set of value will generate weights in a manner were values that are smaller get a bigger weight and bigger one gets a smaller one. The set of value can have N elements and values are always going be a positive integer. I also need to ensure that the difference of weights between two elements of different value is pretty steep.
I created a formulae inspired by the Standard Deviation one. $$\ \sigma = sum_{i=1}^N \frac{(x_i -\overline x)^2}{N}$$ My formulae $$\ W_i = Max(\sigma_p - \frac{X_i - Min(X_0...X_n)}{\sigma}, 0.001)$$
So the idea is $$\delta =X_i - Min(X_0...X_n) $$
$$ NumOfStandardDeviation_i = \frac{\delta}{\sigma} $$
I only care with a precision of 4 Sigma, but technically the value could go over since I'm looking a bell curve and I'm trying to favor strongly being close to no deviation.
$$ W_i = Max(\sigma_p - NumOfStandardDeviation_i, 0.001) $$ where $$\ \sigma_p = 4$$
If I set Sigma, instead of computing it for my current set, I skip some calculations that becomes costy when the set of value grows and it makes the the ending result steeper when I compare value that are close to each other. $$\ \sigma = 0.9$$
It also happen that I want to be as close as possible to $$\sigma = 1$$ I guess that forcing the value, makes it that when I end up calculating my W_i, it gives me weights that will make that sigma happen ''more''.
So, in short.
Does any of this make any kind of sense?
The math does not need to be perfect but more onto ''will give result that looks okay'' as it would be used to pick element out of a set in a game and be computed frequently with a set of value that keeps growing, shrinking, increasing but never decreasing.
I'm kind of expecting my formula to favor picking values that are close to the minimal value since picking it will increase increment it's value by 1, but also let it actually pick any value because I cannot allow it to ''block'' options when picking randomly using a weighted random (cumulative random). Since i'm always incrementing by one, I'm also kind of expecting trying to have all my value be visited once before repicking it again, that is why I want my standard deviation to be as close to 1 as possible and also even less to make it so that being father than 1 SD, drop the picking probability by a lot.
I played a bit in excel, the ending weights made sense to me, but I'm a software engineer, not a master in math :)