1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Twister algorithm

  1. Jan 21, 2008 #1
    okay new problem here. I am doing a Monte Carlo simulation to estimate pi. The question deals with throwing darts randomly at a board with a radius 1 with a square inscribed in it. I have done a script that randomly selected a number b/w -1 and 1. Then I was supposed to generate the results of 500 uniformly random throws using the twister algorithm and seeded with 0.123456

    I approached this by: rand('twister', 0.123456) nothing happened I'm not sure if that is supposed to happen?

    The next part of the question asks you to use this information to estimate pi. To answer this question do I plot the points that were randomly assigned?
  2. jcsd
  3. Jan 21, 2008 #2


    User Avatar
    Science Advisor

    I am afraid you are going to have to explain more. Do you mean b/(w-1) or (b/w)- 1? What are "b" and "w"? What language are you using? "rand" may work differently for different languages (and different compilers for a given language).
  4. Jan 21, 2008 #3

    Sorry, I meant between (b/w) -1 and 1. I am using the MATLAB program.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook