Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Must the random number seed be an unsigned integer?
Must the random number seed be an unsigned integer?
1. The pseudo-random number of the computer is a numerical value calculated by a random seed according to a certain calculation method. So as long as the calculation method is certain and the random seed is certain, the generated random number is fixed.

2. As long as the user or the third party does not set the random seed, the random seed comes from the system clock by default.

The seeds must be there. But the user can not set it, and the system automatically sets the seed as the system clock.

-

First of all, it needs to be declared that computers will not generate absolute random numbers, but only "pseudo-random numbers". In fact, an absolute random number is just an ideal random number. Even if the computer develops, it will not produce a series of absolutely random numbers. Computers can only generate relative random numbers, that is, pseudo-random numbers.

Pseudo-random numbers are not pseudo-random numbers. "Pseudo" here means regular, that is, computer-generated pseudo-random numbers are both random and regular. How to understand it? The generated pseudo-random number sometimes obeys certain laws, and sometimes does not obey any laws; Some pseudo-random numbers obey certain laws; The other part doesn't obey any laws. For example, "there are no two leaves with the same shape in the world", which points to the characteristics of things, that is, randomness, but the leaves of every tree have similar shapes, which is the * * * nature of things, that is, regularity. From this perspective, you will probably accept the fact that computers can only generate pseudo-random numbers, but not absolute random numbers. Strictly speaking, the computer here refers to the electronic computer developed from von Neumann's thought. In the future, quantum computers may generate unrepeatable "true" random numbers according to the laws of nature.

So how are random numbers generated in computers? Some people may say that random numbers are generated by "random seeds". Yes, random seeds are numbers used to generate random numbers. In a computer, such a "random seed" is an unsigned integer.

Satisfied, please adopt! ! !