Computers and randomness: does chance exist?
The question may seem surprising and not all that complicated: how can a computer generate a random number? It is actually a trickier question than it looks and, in the end, a very complicated task.
There is no shortage of examples of random processes in the world around us: rolling dice, tossing coins or, for the more scientific among us, the decay of radioactive elements. These random processes have been used since the dawn of time, the aim being to let chance make a decision. While randomness, or the notion of chance, is fairly simple for humans to conceive, it is nevertheless a very complicated concept to ask of a computer. By nature, computers are deterministic machines: for the same question, you will always get the same answer. Computers were even specifically designed to work this way. Randomness is a parameter we want to eliminate from algorithmic processes. So how do we ask a computer to produce a random number?
The usefulness of random numbers
Before wondering how to do it, a first question might be: "Why would we want to ask a computer to generate random numbers?" Well, to simulate random processes such as dice rolls, prize draws or card games, for example to simulate gambling. We can also mention the simulation of events in video games, or the field of cryptography, for encoding passwords and protecting data. There are therefore many examples of the use of random numbers, and they can be crucial when security or money is at stake.
Randomness and computing
There are two types of randomness in computing, known as pseudo-randomness and "true" randomness. First of all, pseudo-randomness covers all the algorithmic processes that make it possible to generate numbers randomly. What must be kept in mind is that it is impossible to ask a deterministic machine to produce a number at random. The principle generally used is therefore the following: a starting value is chosen, called the seed value. This value is then modified by a transformation algorithm. This algorithm is a process that reproduces randomness, at least in theory. It is a sequence of operations that must be difficult to understand by looking only at the numbers produced. The transformation process of the algorithm must therefore be complex and must not seem, from the outside, to follow an obvious procedure. However complex it may be, since this process is constantly repeated and follows a predefined architecture, the numbers produced are not really random.
These algorithmic processes are therefore not "true" randomness, which does exist in computing. True randomness works with the support of physical elements outside the computer, which really are random. A classic example is to rely on the radioactive decay of an atom. This process is random and, according to quantum theories, it is impossible to predict. The numbers generated from this process are therefore totally unpredictable and in no way follow a predefined pattern. In practice, however, if we want a computer to generate random numbers, it cannot always refer to a random process such as the decay of radioactive elements, so other accessible random processes have to be found. A usual method for computers is to wait for certain user behaviours, such as the exact moment when the user presses one of the keys on the keyboard. As humans are not machines, they are unpredictable by nature.
Different randomness for different uses
It is obvious that the importance of the task to be accomplished will determine the type of randomness to put in place. Pseudo-randomness, although less powerful and useful than true randomness, is by no means useless. In the context of a video game, for example, it does not matter much whether the dealer you are playing against really hands out the cards at random. If you want to choose a representative and evenly distributed sample from a data set, a pseudo-random algorithm may also be sufficient.
On the other hand, in the case of betting or gambling, where users risk losses or gains, the number generation process does need to be perfectly random so that it cannot be predicted. Likewise in cryptography, if the process used to encrypt passwords is too easy to guess, it will be possible to recover the passwords by having access to enough examples. It is therefore clear that the quality of the generation process must be adjusted to the use that will be made of it: the more critical the process, the better the random number generation must be.
Random generation and controversy
To give our computers access to random processes for their usual tasks, processor manufacturers such as Intel offer random number generators based on their hardware. The processor, a computer component often considered to be the brain of the computer, supplies random numbers to the operating system, and does so automatically. Users have no control at all over this process, which is commonly called a "black box". One of the current controversies is that if certain organisations such as the NSA (an American surveillance organisation) have access to a flaw in this process, often called a "backdoor" in the field, they would be able to break the encryption keys provided by this method. These flaws can obviously be knowingly inserted by the creators of the process. This would thus give access to potentially sensitive data, supposed to be secure, to people who must not have it. This aspect is currently the subject of criticism, and many questions are being raised about users' privacy, the control of governments over populations and mass surveillance. Part of the computing community does not consider these systems to be reliable and is working on other methods that do not depend on external elements developed and controlled by companies whose interests may diverge from the general interest. Thus, one of the major challenges of the coming years for free software is to break away from these processes, which may potentially harm users.
Sources:
1 - https://www.sicara.ai/blog/2019-01-28-how-computer-generate-random-numbers
2 - https://www.howtogeek.com/183051/htg-explains-how-computers-generate-random-numbers/
3 - https://www.hypr.com/random-number-generator/
4 - https://engineering.mit.edu/engage/ask-an-engineer/can-a-computer-generate-a-truly-random-number/
Comment ( 0 ) :
Share
Categories
You might be interested in this:
Subscribe to our newsletter
We post content regularly, stay up to date by subscribing to our newsletter.

