The Science And History Of RNG

At one point in history, one of the most popular ways to come up with  a uniform number at random was done with a turtle shell and a fortune teller. Around 1100 B.C. in China, people would bring turtle shells to a fortune teller, where they would use a hot poker to crack the shells and then interpret the cracks into numbers. 

Things have certainly changed since then. With the introduction of dice – an invention that turtles everywhere rejoiced about – it was thought that the perfect way to ascertain a random number was found. But then the computer came along, and digital RNG (random number generation) was finally born. 

The Introduction Of RNG

The arrival of RNG came at a time when the world demanded more random numbers than a dice – or a hot poker, for that matter – could offer. The first was created by a company known as the RAND Corporation, who used those numbers to fill the book A Million Random Digits With 100,000 Normal Deviates. This was mainly used by scientists, mathematicians and researchers who were in need of them, but it didn’t take long before RNG was used for the now-famous purpose: gaming.

Today, several offline and online arcade games make use of RNG to create the ultimate “randomer”. The slot machine, for instance, uses a special RNG program to generate numbers that correspond with the symbols on the reel of the slot. Outside of this, video game developers can also use RNG to generate open-world games, generating moment-to-moment unpredictability without having to code every single section themselves.

The Science Of RNG

The science depends on the two types of random number generators: TRNG – true random number generator — and PRNG – pseudorandom number generator. When it comes to TRNG, no computer algorithm is actually used to define the random number. Instead,  it uses an external variable, entirely unpredictable, to secure a number cryptographically. Sometimes, the variables used are subatomic particles, which are known to exhibit truly random behaviour, ultimately helping the generator to achieve “pure randomness”. 

With PRNG, numbers are selected through a deterministic algorithm that mimics the selection of a truly random number. Developed in 1997, this invention is based on the idea of a linear feedback shift register, which produces a sequence of numbers over long cycle periods. There are a number of different variations of these generators, but PRNG, specifically, is the invention that has stood the test of time, especially when it comes to game development.  

Gaming And Coding

The name John von Neumann is something every science student should know and recognise, as every scientist owes a lot to his findings. It was this man who first developed the PRNG in 1946, and he did so by starting with a random seed value, squaring it, cutting up the middle digits, and then squaring it again – allowing the process to continue. 

While the initial generator was flawed, the invention of computers allowed scientists to run with it. A number of random number generators were formed over the coming decades, with one of the most influential being the Central Randomiser, used with the inception of JavaScript. 

As mentioned before, one of the first entertainment uses came in using RNGs to determine lottery numbers, but since then, PRNG programs have found more uses, specifically in modern video games. For instance, in Red Dead Redemption II, PRNG is used to determine what the player may encounter, what kind of loot can be taken by a fallen enemy, what cards might be dealt in a gambling session, or even what the weather might be in different sections of the map.

RNGs have entirely changed the way we play games – whether they are video games, arcade games, mobile games or the lottery – but they’re also used to help developers and scientists formulate cryptography, sustain browsers, and control online and digital data. 

Over the coming years, it’s easy to see RNGs becoming even more useful and effective at drawing the perfect random number. 

Written by Austin Crane

Austin is the principle web director for Untamed Science and Stone Age Man. He is also the web-director of the series for the High School biology, Middle Grades Science and Elementary Science content. When Austin isn't making amazing content for the web, he's out on his mountain bike or in a canoe.

You can follow Austin Crane