What is a random seed? [duplicate]

3

I asked a question here about a question I had regarding terms used in random number generation.

What is Mersenne Twister?

There I quote that PHP uses a term called "seed random numbers" or "random seed."

This is a reference to the mt_srand and srand functions which, according to the PHP Manual, prior to the 4.1 versions, it was mandatory to use these functions before invoking functions that generated random numbers ( mt_rand and rand ).

And I get the impression that I have seen these "seed" functions in C .

What is a random seed?

Why, prior to these versions, was it necessary to call a sower, and now is it no more?

    
asked by anonymous 16.12.2015 / 20:54

1 answer

3

Quick response: because they have changed the algorithm for Mersenne Twister .

A random seed is any number or vector used to initialize a pseudorandom number generator which in turn is a deterministic algorithm for generating numbers whose sequences are approximately what you would expect from numbers (actually, if) random. The importance of generating good random numbers has to do with its myriad applications, from cryptography to computer simulation.

In versions 4 and 5 of PHP there is a function ( mt_rnd ) to replace the use of the pseudo-random number generator of the old libc with rand because the previous algorithms were slower and there were suspected undesirable features to calculate good random numbers. The new version actually uses Mersenne Twister which is the most common algorithm in the world to generate this kind of numbers (at least for the most common applications).

    
17.12.2015 / 08:42