Seed issue and Direction of Movement

Seed issue and Direction of Movement

by Yijie Wang -
Number of replies: 1

Hi professor, could you explain how we can incorporate a seed into the simulation. It seems to me that I can use the random library to generate random numbers and no seed is required (see slide 21 from lecture 17). 

The other question I have is for different directions, we have different probabilities. It's unclear which direction the walker will take. (I saw the other post, but it's still a bit confusing..)

Thank you for replying!

In reply to Yijie Wang

Re: Seed issue and Direction of Movement

by Ramses van Zon -
Pseudo random numbers always have a seed. What happens on slide 21 is that you let the random library pick one; that is, however, not reproducable. If you look on slide 19, you see that you can pass a seed to the engine.

Yes, there are several directions possible. You need to use the random number generator to decide which to take. There are a few possibilties on how to do that, but if you draw a random number c between 0 and 1, you can pick the left move if c