dimanche 3 septembre 2023

Why are new seeds derived from older seeds in pseudo random number generators?

I looked through Java's Random class and saw that the initial seed is created using:

public Random() {
        this(seedUniquifier() ^ System.nanoTime());
    }

But every consecutive seed is derived from old seed using:nextseed = (oldseed * multiplier + addend) & mask;

Why is new seed derived from old seed instead of being derived from system time every time? Maybe even put the system to sleep randomly (0-10ms, depending on last digit of system time or something like that) to ensure even more randomness.




Aucun commentaire:

Enregistrer un commentaire