Change seed for each generated random number
Suppose you generate random numbers using the seed as the elapsed time in seconds since January 1970, as in the Microsoft library. But you change the seed after every random number generated. This will give a truly random result. Why or why not?
Edit I had one more part of the question. What if I get the seed to be non-deterministic. For a small example, let's say the seed is generated by a pre-existing TRNG (True Random Number Generator). In other words, if I can somehow make the seed non-deterministic, I can create a random sequence, that is, a non-deterministic sequence. Why or why not?
source to share
Basically, your technique is simply toggling "randomness" for when you call the random () function: if you call the function at deterministic times (for example, once a second), the results will be deterministic. If you call a function at a random time, the results will be random.
More precisely, it depends on what value you call the seed () function. If you call seed () with deterministic values, the results of the subsequent call to random () will be deterministic.
update (on request):
The software random generator is FULLY deterministic; the sequence of values ββit produces is exactly what you pass to the original call to seed (). As a result, if you call seed () with a known value, you can predict exactly what series of values ββyou will receive from subsequent calls to random (). If you call seed () with a truly random number, then random () calls will be appropriately random.
(But this begs the question: if you have a random number to pass to seed (), why call random () at all?)
source to share