What is a Random Number Generator?

Random Number Generators or RNGs are used in a variety of processes everyday in our modern world. While we might take for granted the encryption of our banking data or the spinning prize wheel on our favorite mobile games, RNGs are behind it all. 

This mathematical construct (as well as natural process) is the backbone of cryptographic operation in modern computing and can be used or harnessed to protect our information, secure data, power online casino games, and decide who wins the lottery.

So, what is a Random Number Generator?

A random number generator is simply a randomness device such as rolled dice, flipped coins, or shuffled cards. Modern RNGs are typically hardware devices or software algorithms that generate numbers from a limited or unlimited distribution and outputs them.

Computer-based RNGs are deterministic, meaning that a pattern exists and therefore, not truly random. Although as we’ll see later on, there are other types of RNGs that can be derived mechanically or from natural processes in the physical world.

Examples of Random Number Generators

Despite their many applications in modern science and technology, random number generators have existed since ancient times in the simple, yet chance-based methods of arbitrary decision-making.

  • Dice
  • Shuffled cards
  • Flipping coins
  • Drawing straws

While these examples of RNGs are mechanical in nature, they are far too slow to be used in statistical analysis or cryptography. For that reason, the vast majority of random number generation occurs by means of algorithmically-produced computational software.

The Role of Entropy

Entropy is a scientific concept as well as a measurable physical property that is defined as a lack of predictability, associated with disorder, uncertainty, and randomness. As such, RNGs are a source of entropy in the universe. 

If entropy is an unfamiliar concept, it may help to think of it as the uncertainty in natural and physical events from a subatomic level to the movement of galaxies. Some examples of entropy include radioactive decay, the photoelectric effect, cosmic background radiation, and atmospheric noise.

Types of Random Number Generators

There are two types of RNGs out there and the difference between the two is deterministic. The first are True RNGs and the second are Pseudo RNGs. The main difference between them is how the numbers are generated.

  • True RNGs (TRNGs) – natural, unpredictable phenomena
  • Pseudo RNGs (PRNGs) – computer-generated algorithms

TRNGs: True RNGs are where the idea of entropy comes into play. True randomness in the universe, completely unpredictable events and behaviors are the foundation for the generation of numbers here. 

TRNGs use unpredictable physical phenomena in the natural world to generate random numbers. These can be occurrences of radio/thermal/atmospheric noise or other quantum and electromagnetic phenomena. 

Additional sources of entropy (TRNGs) include subatomic physical phenomenon like radioactive decay, a process that occurs with unpredictability and randomness that can only be explained by the laws of quantum mechanics.

PRNGs: The more common RNGs that most of us are familiar with are PRNGs, those found in casino games and slot machines. Deceptively, these are not truly random at all but rather based on mathematical algorithms. 

Any time that mathematics is involved, you can be sure that there is at least an element of predictability, meaning that it is not completely random. It is for this reason that many experts who use RNGs in the field have started looking into a combination of true and pseudo RNGs to create a more random environment of unpredictability.

The most common PRNG is the linear congruential generator that uses the following formula:

X_{n+1} = (a X_n + b){mod} m

In this formula, X is the pseudorandom number and X_{n=1} is the next number in the series.

Claim Your Bonus at Crypto Loko Casino
Exclusive43 Free Spins on Spring Wilds
Use Code:

Applications for Random Number Generators

A random number generator is designed to generate numbers in a random and indistinguishable way. There should be no way to identify a pattern in their generation, hence, “random”. For this reason, RNGs are commonly used in software applications where an element of chance is desired. 

RNGs are used in a multitude of different applications, including the following processes, actions, and industries.

  • Computing
  • Online Gambling
  • Finance / Cryptocurrency
  • Data Encryption / Cryptography
  • Telecommunications Systems
  • Stochastic Modeling
  • Monte Carlo Simulations
  • Statistics

Today, we’re going to talk about a few of these applications and how RNGs make them possible.


The science of computing relies on random numbers in order to function. RNGs are behind all of the unpredictability that is required for modern computing systems to operate as desired. They are the key to things like TCP/IP sequence numbers, TLS nonces, ASLR offsets, password salts, and DNS source port numbers, all of which are important data packets that allow your computer or mobile device to function. 

Data Encryption / Cryptography

Cryptography and data encryption are typically based on cryptographic algorithms that use RNGs to generate seeds and keys. These seeds and keys can be used to decrypt information so the more random and difficult to discern, the more secure the information will be. 

The ongoing problem with this method, however, is the algorithmic model of seed/key generation. If a hacker or cybercriminal is able to determine the algorithm, the information is no longer safe. 

Recently, researchers have theorized a truly random method of data encryption by means of True RNGs with high entropy, rather than the old model of algorithmic RNGS or Pseudo RNGs. In this model, the TRNG used would be data from the visible spectrum or electromagnetic waves to generate extremely random and unpredictable numbers. 

Online Gambling

In terms of software, new online casinos make use of a platform that imitates the actions of games or dealers in live casinos by means of computer algorithms. These are Pseudo RNGs because they utilize a seed or key that can be used to determine and predict the outcome of the next spin or roll. 

While most online casino games are effectively just computer simulations, the use of random number generators in the software does, in fact, mirror real life odds. The way it works is that any time the online casino game software needs to reproduce a random outcome, it communicates with the RNG, which then feeds it into the software. 

This works for all kinds of virtual casino games, such as cards being dealt in poker or blackjack, numbers spun in roulette, symbols in view in slot games, and numbers rolled in dice games like craps.

Claim Your Bonus at Punt Casino
Exclusive15 Free Spins on Mariachi Party
Use Code:

Limitations of Random Number Generators

RNGs are not as “random” as you might think. If you know the algorithm, you can easily determine what number the RNG will show in its output. With the algorithm’s seed or key, you could also even predict the pattern itself, cracking the code and rendering the RNG useless.

An example of RNG limitations can be seen in the 1980’s television game show, Press Your Luck. Players stop a seemingly random light to either win money, gain more turns, or lose everything. A man named Michael Larson recorded the television show and realized that the RNG they used actually had a very specific pattern. Once he memorized the pattern, he was able to go on the show and win over $100,000. 

So, despite the slight misnomer of “random”, the main point is that any and all output will appear random to anyone who does not know the specific algorithm. It is this semi-randomness that allows computer-based RNGs to be vulnerable to hackers (or savvy game show contestants). 

Another example of the limitations of RNGs is their use in video games, lotteries, bingo, and other card games. In these instances, if the RGN were truly random, there would be inconvenient repetitions since it can go a long time without the target number being hit or the same number can be obtained repeatedly. 

In our examples, this kind of repetition or absence of target numbers can cause games to go haywire, failing to provide a winner, loot collection, etc. Because of this, RNG algorithms must also include additional subroutines that keep numbers from repeating too often. 

The more math involved, the more algorithms, subroutines, and blocks of code — the less random the output of numbers will inevitably be.

Moving Toward True RNGs

Due to these limitations of traditional RNG models, mathematicians have suggested using quantum systems or classically chaotic systems to produce chaos-based true random number generators.

Since TRNGs are more difficult to work with for obvious reasons, the rule of thumb among experts is that a good random numbers generator consists of two parts: a source of entropy and a cryptographic algorithm.

The hybrid approach is the best method we currently have for obtaining true randomness, although the natural harvesting approach is time-consuming, slow, and sometimes expensive. This tends to result in a fallback to re-seeded software-based cryptographically secure pseudorandom number generators (CSPRNGs).

As methods and natural harvesting continues to improve, so too will the randomness required to better encrypt data, protect IT security and financial transactions, and make virtual games truly games of chance.

Published on: 2021/12/02

About the Author

Hi, I'm Ian, the Chief Editor at NoDeposit.Guide - With hundreds of reviews and thousands of no deposit bonuses, NoDeposit.Guide is certainly your one-stop destination for free online gambling. Our bonuses are updated daily and we pride ourselves on providing the highest percentage of working bonus, worldwide.