Search code examples
randomnumbersintegergeneratorhelper

Is random real in programming?


I am in the process of building a brute force applicaiton however when thinking about encoding, there are codes online that use the word "random" however are they actually totally random numbers generated by the computer. I say this because the way havent been taught about how computers work, goes against this word "random"

Am I correct in thinking there is no "random" in computers? or have I misunderstood.


Solution

  • Various platforms provide a pseudo random number generator, which is:

    an algorithm for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers.

    A lot's already been written here and on other sites why generating a truly random sequence of numbers is hard for machines, see for example Is /dev/random considered truly random?, How can I generate truly (not pseudo) random numbers with C#? and so on.

    From Can a computer generate a truly random number? | MIT School of Engineering:

    “One thing that traditional computer systems aren’t good at is coin flipping” [...]

    There are devices that generate numbers that claim to be truly random. They rely on unpredictable processes like thermal or atmospheric noise rather than human-defined patterns.