Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I wonder whether following methodology is correct.

I need to introduce concurrent processing to my simulating application.I want to use Mersenne Twister random generator. I wonder whether I can create a few instances of this generator (initialized with different seed, base on time of creation) and use them in separated threads. The problem is whether there will be no connection between values I get from multiple instances of random generators initialized with different seeds.

Do you have any experience with it / advices ?

(I know that this question might be asked in stackoverflow however I think that is a little bit more mathematical problem).

share|improve this question
add comment

1 Answer 1

It depends on how many random draws you're likely to make from the generator, how many threads you will be running and how long the cycle length of the generator is.

The main problem with parallel Monte Carlo comes from overlap of random sequences initialized with different seeds.

As a very rough approximation, if the cycle length is $N$ and you are running $q$ threads, each of which makes $n$ draws, then you are effectively choosing $p$ objects from among $p=N/n$. Therefore the probability that none of your sequences overlap is roughly

$$f(N,n,p) = \frac{p(p-1)\cdots(p-q+1)}{p^q} = \frac{p!}{(p-q)! p^q}$$

As long as this number is significantly less than 1, you should be fine.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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