FreshRSS

Normální zobrazení

Jsou dostupné nové články, klikněte pro obnovení stránky.
PředevčíremHlavní kanál

Randomization algorithm that trades between more variance and higher total value

I need to generate discrete integer variables that each have meaning, so does their sum. I am essentially looking to partition a normal distribution into n bins. You can think of them as stats. The total obviously matters, but if we always equally distribute them, an item with higher total stats would be strictly better than one with lower total. We can't have that. Therefore, I had the idea to "reward" the player with bigger variation if the generated sum is low. I just do not know how to achieve this.

Generating a total value from a normal distribution is easy. However, I don't know how to distribute them in the way I described. Below are methods I have tried:

  1. Start with an equal partition, for a random number of steps, increase a random stat by 1 and decrease another by 1. Problem: the values always seem to be stuck near the beginning.

  2. Start with an equal partition that is higher than the desired average. For a random number of steps, increase a random stat by 1 an decrease all others by 1. Problem: this seems to just universally lower all the stats without producing the variation I wanted. The sum total is also not normally distributed.

  3. Randomly generate the first (n-1) variables from normal distributions, and fix the last one. Problem: this produces very predictable results. Each sample looks more or less the same.

Is there an algorithm that achieves this except just to generate many samples until it has the desired distribution?

❌
❌