1
$\begingroup$

I have reached a chapter in the notes I am following where a program written in C++ is using a Monte Carlo method to estimate $\pi$. It mentions a 'seed', but does not say what this is. I have tried finding out what a seed is online, but I only seem to get results about 'why you should/shouldn't use a fixed seed', and unfortunately they have left me none the wiser as to what a seed actually is.

What is seed in this context?

$\endgroup$
2

2 Answers 2

2
$\begingroup$

The seed is an initial number of the pseudorandom number generator(PRNG) which is in fact fully deterministic. It returns a sequence of numbers that looks random enough for many purposes, but always generates the same sequence for given value.

In order to make simulation non-repeatable (returning always the same value) they advice different initial value for every simulation (this is what non-fixed seed means). Seed scheme

Image taken from here

$\endgroup$
0
$\begingroup$

The other way to think of a seed is that it allows you to get the same string or random numbers for different runs. If you are building an algorithm, sometimes being able to repeat how you got to a place is very useful. It allows you to debug equations and logic.

$\endgroup$
1
  • $\begingroup$ (That's a typo my spelling checker fails to flag, too: or in stead of string of uncorrelated….) $\endgroup$
    – greybeard
    Commented Aug 16, 2020 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.