0

I've looked around for a bit, and found that this is to do with the Irwin-Hall distribution, however I don't know anything about calculus/statistics, could someone explain to me in baby terms how I would go about making the sum of n random numbers uniform? Need this for layering perlin noise I've generated.

Is there some operation I can do to the numbers to get a uniform sum? Or even an approximation?

  • It clearly can. – matidfk Jan 22 '22 at 11:59
  • I have no idea what you are asking. In general you cannot simply 'make' random variables uniform. – vshas Jan 22 '22 at 12:02
  • When you add two random numbers, you get a pyramid distribution, so surely there must be some function to spread them out to get them back to a uniform distribution – matidfk Jan 22 '22 at 12:04
  • Well you could apply the c.d.f. of the Irwin−Hall distribution on it. – nejimban Jan 22 '22 at 12:05
  • as I said, I don't know much about statistics so I have no idea what x, k and n stand for in the equation, or even how to multiply the parentheses with two numbers on top of each other – matidfk Jan 22 '22 at 12:17
  • @matidfk If $x$ is the sum of $n$ independent uniform variables then $\sum_{k=0}^{\lfloor x\rfloor}\frac{(-1)^k(x-k)^n}{k!(n-k)!}$ will be uniformly distributed on $(0,1)$. Here, $\lfloor x\rfloor$ is the smallest integer greater than or equal to $x$ and $k!=k(k-1)\cdots1$ is the factorial. – nejimban Jan 22 '22 at 15:47

1 Answers1

0

Imagine the simplest discrete analogue of that problem. You have two 6-sided dice and you want to assign probabilities $p_1,\ldots,p_6$ to the sides, so every sum from $2$ to $12$ has the same probability $p=\frac1{11}$.

What is the probability to throw $2$? It's $p_1^2$. So we conclude that $p_1=\frac1{\sqrt{11}}$. What is the probability to throw $12$? It's $p_6^2$, so we conclude that $p_6=p_1=\frac1{\sqrt{11}}$.

Now what is the probability to throw $7$? It's: $$ P(X_1+X_2=7) = p_1p_6+p_2p_5 + \ldots+p_5p_2+p_6p_1 = \frac2{11} + 2p_2p_5+2p_3p_4. $$

We have a problem, we cannot assign non-negative values to $p_2,\dots,p_5$ for this expression to be equal to $p=\frac1{11}$.

Thus in the case of independent variables, there is also a limit to how high can tails be relative to the centre values.

Vasily Mitch
  • 10,129
  • So there is no function that spreads the distribution out to be uniform again? – matidfk Jan 22 '22 at 13:07
  • Yep. The probability in the centre will be always larger then the probability of some margin value – Vasily Mitch Jan 22 '22 at 13:16
  • So is there any other option I have to stop a sum of random values being mostly in the centre? – matidfk Jan 22 '22 at 13:30
  • Make them dependent. – Vasily Mitch Jan 22 '22 at 14:24
  • But in my scenario, I'm trying to layer perlin noise where each octave has a smaller scale, so making them dependent is not possible. I suppose I could just layer them normally however I was curious whether there was a solution to most of the values being towards the centre – matidfk Jan 22 '22 at 19:01