Estimating Pi with Twister Algorithm & Monte Carlo Simulation

  • Thread starter Thread starter bobsmiters
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
SUMMARY

The discussion focuses on using the Twister algorithm in MATLAB to perform a Monte Carlo simulation for estimating the value of Pi. The user attempts to generate 500 uniformly random throws within a unit circle using the command rand('twister', 0.123456) but encounters issues with the output. Clarification is sought regarding the plotting of points and the interpretation of variables 'b' and 'w' in the context of the simulation.

PREREQUISITES
  • Understanding of Monte Carlo simulations
  • Familiarity with the Twister algorithm for random number generation
  • Basic knowledge of MATLAB programming
  • Concept of estimating Pi using geometric probability
NEXT STEPS
  • Learn how to properly implement the Twister algorithm in MATLAB
  • Research methods for visualizing Monte Carlo simulation results in MATLAB
  • Explore the mathematical basis for estimating Pi using random sampling
  • Investigate the differences in random number generation across programming languages
USEFUL FOR

Mathematics enthusiasts, MATLAB programmers, data scientists, and anyone interested in computational simulations for estimating mathematical constants.

bobsmiters
Messages
12
Reaction score
0
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?
 
Physics news on Phys.org
bobsmiters said:
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?
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).
 
Re

Sorry, I meant between (b/w) -1 and 1. I am using the MATLAB program.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K