7
$\begingroup$

In general (and in real application), suppose I am using a randomized algorithm (e.g. Use MCMC to sample from a distribution and then compute $E(f(x))$ for some function $f$)

Assume my algorithm will face every possible input and I use a pseudo-random generator to provide randomness.

Shall I derandomize my algorithm by fixing a random seed every time the algorithm start?

The reason that I come up with this question is that by derandomizing it, I can make sure every input will have a corresponding output, which makes me feel more comfortable for practical use. However, I believe I will lose something (maybe the algorithm works very bad for worst case input) if I derandomizing it like this.

$\endgroup$
5
$\begingroup$

You definitely want to derandomize your program during development. Otherwise you will not be able to debug it since problems are not reproducible.

At the same time, once you know the algorithm is working, you need to run it for multiple seeds or with different random number generators to ensure that your results (such as ensemble averages, standard deviations, etc) are independent of the actual sequence of random numbers.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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