1

Though I have referred about the meaning of seed in google,I can't get the exact answer that I want.Can anybody explain with an example?

abubakkar
  • 187
  • 13
  • Possible duplicate of [What does 'seeding' mean?](http://stackoverflow.com/questions/1619627/what-does-seeding-mean) – phuclv Jul 27 '16 at 05:44
  • another dup: [What is a seed in terms of generating a random number?](http://stackoverflow.com/q/14914595/995714) – phuclv Jul 27 '16 at 05:44

2 Answers2

2

It's an initial value for a random number generator to base its sequence of random numbers on. If you seed two random number generators with the same value, they'll produce the same sequence of numbers. This is useful for testing purposes. In production, you typically seed a random number generator with a value that's hard to guess, like the millisecond value from your system clock.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
0

A seed is used to initialize a pseudorandom number generator. It is a starting point for all random numbers to be generated. If you initialize a PRNG with the same seed, for example a number 100, you will always get the same numbers generated and the results will be deterministic (that can be useful for testing). If you initialize the PRNG with a variable value, for example a timestamp, you should get different results with high probability (used in production). Refer to:

http://en.wikipedia.org/wiki/Pseudorandom_number_generator

http://en.wikipedia.org/wiki/Random_seed

Bartosz
  • 732
  • 9
  • 30