What does 'seeding' mean?

前端 未结 4 1935
小蘑菇
小蘑菇 2020-11-29 08:36

Very simple question. What does the term \'seeding\' mean in general? I\'ll put the context, i.e., you must seed for random functions.

相关标签:
4条回答
  • 2020-11-29 09:00

    "Seeding" random function prevents it from giving out the same sequence of random numbers. Think of it as a super-random start of your random generator.

    0 讨论(0)
  • 2020-11-29 09:03

    Imagine a card game and development of the game program vs. running the game to actually play it.

    Pseudo-random number generators use a seed or seeds to determine the starting point of the sequence. Some of them always make the same sequence, others can produce different sequences depending on the seed. Some use a cascade, a simple RNG is given a simple seed, and this is run for a while to produce a more complex seed for the masterpiece RNG.

    It is quite useful to be able to deliberately repeat the sequence when developing the program or when one wishes to reproduce previous results.

    However, imagine a card game. It's obviously not a good idea to always deal the same sequence of cards.

    0 讨论(0)
  • 2020-11-29 09:16

    It means: pick a place to start.

    Think of a pseudo random number generator as just a really long list of numbers. This list is circular, it eventually repeats.

    To use it, you need to pick a starting place. This is called a "seed".

    0 讨论(0)
  • 2020-11-29 09:22

    Most random functions that are common on personal computers aren't random, but deterministic to a degree. The 'seed' for these psuedo-random functions are the starting point upon which future values are based. This is useful for debugging purposes: if you keep the seed the same from execution to execution you'll get the same numbers.

    To get numbers that are more random a different seed is often used from execution to execution. This is often based on the time of the machine.

    This method is completely different than generating a 'true' random number based on some sort of physical property in the world around us. Lava lamps and sun spots are two of the more 'fun' properties that can be observed to generate 'more random' numbers. Anyone can hit http://www.random.org/ to get a real random number if its truly neccessary like for a poker website. If you don't have a good generator folks can attempt to figure out how the generator works and predict future numbers.

    0 讨论(0)
提交回复
热议问题