A Comparison of Monte Carlo Methods with Systematic Point Selection
description
Transcript of A Comparison of Monte Carlo Methods with Systematic Point Selection
KATHERINE STAMMER
INTRO TO SYSTEMS ENGINEERING
A Comparison of Monte Carlo Methods with Systematic Point
Selection
Overview
Using Monte Carlo Methods to calculate πUsing systematically selected points to
calculate πMathematical analysis of the methodsExperimental ResultsComparison of the two methodsConclusion
Using Monte Carlo to Calculate Pi
A circle with diameter one is placed inside a one by one square
Area of the circle is π /4 ( )Area of the square is onePoints are randomly selected within
the square and are evaluated to see whether or not they land inside the circle.
The ratio of points inside the circle to the total number of points is equal to the area of the circle.
π can be found by multiplying this ratio by 4.
1
1
Hypothesis
My hypothesis was that π could be more accurately calculated by selecting a grid of evenly spaced points to test rather than by randomly selecting points.
http://www.ysbl.york.ac.uk/~cowtan/clipper/doc/map_p1.png
http://people.sc.fsu.edu/~burkardt/m_src/voronoi_new/hundred_points.png
Systematically Selecting Points
An evenly spaced grid of points are selected to be tested.
Similarly, the ratio of points inside the circle to the total number of points is equal to the area of the circle
π can be found by multiplying this ratio by 4
1
1
Monte Carlo Systematic Point Selection
Accuracy is of the order where n is the number of points in the circle
For a given trial:
Accuracy is of the order n where n is the number of points in the circle
Example: If 10,000 points are tested, the number of points within the circle is 7,827. When this four digit number is divided by 10,000 the result is 0.7827.
Mathematical Analysis
Testing
Developed a program in Matlab that randomly selected points Selected 100 points Tested these points to
see if they were inside the circle
Computed π Repeated with a step
size of 100 points until reaching 100,000 points
Developed a program in Matlab that iterated across two dimensions Selected a grid of 100
evenly spaced points Tested these points to
see if they were inside the circle
Computed π Repeated with a step
size of 100 points until reaching 100,000 points
Experimental Results: Convergence of Methods
Red is Systematic Point Selection and Blue is the Monte Carlo MethodThis graph shows the values of π as calculated using from 100 to 10,000 points in increments of 100
Number of Points Tested
Experimental Results: Convergence of Methods
Red is Systematic Point Selection and Blue is the Monte Carlo MethodThis graph shows the values of π as calculated using from 100 to 100,000 points in increments of 100Number of Points Tested
Monte Carlo Systematic Point Selection
Takes less computing time per calculation of π
Can be used in situations where the shape is unknown
Converges more quickly
If the form of the shape inside the box is unknown, systematic point selection may give inaccurate results
Advantages and Disadvantages of Each Method
Conclusions for the Calculation of π
Systematic Point Selection can provide an accurate method for calculating π.
In the case of calculating π, Systematic Point Selection converges more quickly than the Monte Carlo Method.
In this case it is known that the shape we are finding the area of is a circle.
General Conclusions
Systematic Point Selection is a good method to use if the shape of the area you are calculating is known and additional computing time is not a problem.
However, the Monte Carlo Method is a better choice if you do not know the shape you are finding the area of or if it is a shape that does not work well with a grid of points (such as many tiny evenly spaced shapes).
Thank You
Aaron Mosher for his help with MatlabAnatoly Zlotnik for his assistance with the
mathematical calculations of error
Questions