Skip to content


Randomness is a way to generate non-humanly predictable behavior based on a mathematical computation. It is often mistaken with a shuffle pattern that is one way of randomizing data.

General Concepts

Random functions are mostly determined by a seed, a polynomial function, an amplitude and a frequency.


The seed is a parameter of the random function that will influence the degree of uniqueness of the random.

Simple randoms based on an integer seeds are made to be reproducible and every random sequence for a given seed will be the same every time the random function is called.

Sequences and distribution

Sequences of random numbers are the result of a series of queries on the random function. Every time the random function is queried it will return one data (for instance a number).

For example, querying 44 times a random function that returns a number between 0 and 9 can return:


This sequence is supposed to return the same proportion of 0's, 1's, 2's. However, in our case we have the following counts:

0 1 2 3 4 5 6 7 8 9
5 5 3 4 6 4 2 5 3 6
11.3% 11.3% 6.8% 9% 13.6% 9% 4.5% 11.3 6.8% 13.6%

If we did expect a count per value it should be 44 items divides by the amount of different items : 10 so 44/10 = 4.4 that would lead to a 10% chance for every item.

Now if we query this same sequence, but 440 times instead of 44:


Now if we redo the counting of occurrences of every number we obtain the following:

0 1 2 3 4 5 6 7 8 9
41 53 48 50 37 37 42 41 45 46
9.3% 12% 10.9% 11.3% 8.4% 8.4% 9.5% 9.3% 10.2% 10.4%

While this is still not perfect, we can see the proportion of every number has slightly evolved so every proportion tends to be closer to 10% this time.

This is actually because any random distribution will tend to any kind of percentage as the amount of data increases.


Determinism is the way of having a random pattern to be reproduced identically. It is mostly determined by the seed of the function and its parameters.

We call a function deterministic when it returns an absolute exact sequence every time it is queried. Most of the time, it involves