Estimating Pi with Twister Algorithm & Monte Carlo Simulation

  • Thread starter bobsmiters
  • Start date
  • Tags
    Algorithm
In summary, the conversation is discussing a problem regarding a Monte Carlo simulation to estimate pi. The question involves randomly throwing darts at a board with a radius of 1 and a square inscribed in it. The approach involves generating 500 uniformly random throws using the twister algorithm, but there was an issue with the code. The next step is to use this information to estimate pi, but more information is needed to understand the problem and determine the correct approach.
  • #1
bobsmiters
12
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
  • #2
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).
 
  • #3
Re

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

Related to Estimating Pi with Twister Algorithm & Monte Carlo Simulation

What is the Twister Algorithm and how does it relate to estimating Pi?

The Twister Algorithm is a pseudo-random number generator that is commonly used in Monte Carlo simulations. It is particularly useful for estimating Pi because it produces a sequence of numbers that are uniformly distributed between 0 and 1, which can be used to approximate the value of Pi through geometric calculations.

What is a Monte Carlo simulation and why is it used for estimating Pi?

A Monte Carlo simulation is a computational method that uses random sampling to model and analyze complex systems. In the context of estimating Pi, a Monte Carlo simulation involves randomly placing points within a square and determining the ratio of points inside a quarter circle to the total number of points. This ratio can be used to approximate the value of Pi.

How accurate is the estimation of Pi using the Twister Algorithm and Monte Carlo simulation?

The accuracy of the estimation of Pi using this method depends on the number of iterations or points used in the simulation. Generally, the more iterations that are used, the closer the estimation will be to the actual value of Pi.

What are the advantages of using the Twister Algorithm and Monte Carlo simulation over other methods of estimating Pi?

The Twister Algorithm and Monte Carlo simulation are advantageous because they are relatively simple and efficient methods for estimating Pi. They also do not require any prior knowledge of Pi, making them accessible to a wide range of users.

Are there any limitations to using the Twister Algorithm and Monte Carlo simulation for estimating Pi?

One limitation of this method is that it relies on random sampling, which means there is a possibility of getting an inaccurate estimation. Additionally, it may not be the most efficient method for estimating Pi compared to other more complex algorithms that are specifically designed for this purpose.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
2K
Replies
0
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
665
  • Calculus and Beyond Homework Help
Replies
1
Views
4K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
4
Views
997
Back
Top