How is random generated?

21 Views Asked by At

I was wondering how random is generated in math, because there isn't functions in order to do that isn't it? (I'm at High School)

PS: I'm new to this site, be indulgent ;)

1

There are 1 best solutions below

0
On BEST ANSWER

True randomness is difficult to define, and basically impossible to achieve through calculations. Psuedorandomness, however, share many of the same traits and is perfectly possible to achieve using deterministic algorithms.

Most of them work something like this: It starts with a (relatively large) integer $n$, and applies some function $f$ to it to get an integer $f(n)$. It then spits out the last digit of $f(n)$. The next time you ask it for a random number, it starts with $f(n)$, calculates $f(f(n))$, and spits out the last digit of that, and so on.

It's next to impossible to deduce what the next "last digit" is going to be based only on previous last digits (at least if you choose $f$ well), so from what you see on the outside, the machine produces unpredictable, random numbers. But on the inside, it works in a completely predictable manner.