Randomness of Random Number

Allan Muturi
2 min readMar 30, 2024
Wall of entropy

Today I have been thinking a lot about how computers generate random numbers and this led me into a curiosity hole. I went through various sites and YouTube videos trying to get to the meaning of randomness. and finally came to have a better understanding of it.

A computer is logical and every part of it is made to be predictable as possible I guess we all understand the concept of GIGO(Garbage In Garbage Out). It is therefore nearly impossible for computers to generate completely random numbers. Most of the random numbers that a computer generates are known as pseudo-random numbers which means random numbers that have been generated through a deterministic process.

If all you need is one random number this may be fine, but if you need a sequence of them, the series typically starts with a common ‘seed’ number and then follows a pattern, because of the algorithm it uses.If a person gets to know the algorithm and the seed he can therefore predict a series of random numbers.

Most random number generator functions incorporate a lot of variables to compute a random number. The variables include:

The current process ID
The current thread ID
The tick count since boot time
The current time
Various high precision CPU performance counters
An MD4 hash of the user’s environment (username, computer name, search path, etc)

In conclusion, while computers inherently lack the ability to generate true randomness, they employ sophisticated algorithms known as pseudo-random number generators to produce sequences that mimic randomness. Understanding the limitations and challenges associated with pseudo-random number generation is crucial for ensuring the reliability and security of applications that rely on random numbers.

By comprehending the nuances of random number generation, we can harness the power of randomness effectively across various fields, driving innovation and progress in the digital age.

Stay curious 🎉

--

--

Allan Muturi

Mobile, web developer and a mathematics and computer science graduate who likes to play with both software and hardware.