December 1, 2023 3 min read

Randomness of a Computer

Randomness of a Computer erkol.dev blog image

Generating random numbers is crucial for various applications like cryptography, digital wallets, machine learning, games, and numerous others. However, obtaining random numbers from computers presents significant challenges.

What is Randomness?

While Wikipedia defines randomness as the absence of predictable patterns, computer-generated random numbers appear inherently predictable. This stems from the deterministic nature of computers, where outputs are always determined by inputs. However, specific methods exist to generate seemingly random numbers from these deterministic systems.

Why should computers generate random numbers?

Random numbers are very important for many things we do online. They help in activities like lotteries and keeping our information safe. These random numbers are like a hidden force that shapes the online world. It's really important that these numbers are truly random because it helps people trust what happens online, makes sure things are fair, and allows us to do more with technology in the future.

⁠How computers generate random numbers?

There are ways to generate random numbers, as I mentioned before. Pseudorandom number generators (PRNGs) are often used to produce sequences of numbers that seem random but are actually generated in a predictable way. For many purposes, PRNGs work well, but in situations where security or unpredictability is crucial, true random number generators (TRNGs) are preferred. TRNGs rely on naturally random physical processes, like electronic noise or radioactive decay, which are unpredictable, to create random values.

1) True random number generators (TRNGs)

Also known as hardware random number generator (HRNG) or non-deterministic random bit generator (NRBG) is a device designed to generate random numbers by utilizing environmental sources such as entropy, electronic noise, radioactive decay, and cosmic microwave background radiation. However, due to their additional cost and complexity when compared to Pseudo-Random Number Generators (PRNGs), they do not often offer significant advantages. True Random Number Generators (TRNGs) are primarily employed in applications where their unpredictability and the inability to reproduce the sequence of numbers are critical to the success of the implementation, notably in cryptography and gambling machines.

TrueRNG2.png

2) Psudorandom number generators (PRNGs)

Also known as deterministic random bit generator (DRBG), PRNG is an algorithm used to generate a sequence of random numbers. Unlike True Random Number Generators (TRNGs), the numbers generated by Pseudo-Random Number Generators (PRNGs) are not truly random; they are determined by an initial value known as a seed, which may incorporate genuinely random numbers. However, PRNGs are crucial in practical applications due to their rapid generation of numbers and the ability to reproduce the same sequence when provided with the same seed.

Summary

To sum up, similar to other domains within computer science, a trade-off exists between Pseudo-Random Number Generators (PRNGs) and True Random Number Generators (TRNGs) concerning factors like speed, reliability, and reusability. Due to this trade-off, some companies specialize in selling random numbers produced through diverse analog processes, including methods such as monitoring cosmic microwave background radiation, observing radioactive decay, or other analogous procedures.

References

Tags

Computer
Random Number Generators