1. Trang chủ
  2. » Ngoại Ngữ

Estimating through Monte Carlo Methods in n-dimensions

57 2 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Estimating π Through Monte Carlo Methods In n-dimensions
Tác giả Brian Reece
Người hướng dẫn Heather Thompson, Co-Major Professor, Irvin R. Hentzel, Co-Major Professor, Alejandro Andreotti, Committee Member
Trường học Iowa State University
Thể loại creative component
Năm xuất bản 2006
Định dạng
Số trang 57
Dung lượng 1,08 MB

Nội dung

Estimating  through Monte Carlo Methods in n-dimensions Brian Reece Iowa State University MSM Creative Component June 30, 2006 Heather Thompson, Co-Major Professor Irvin R Hentzel, Co-Major Professor Alejandro Andreotti, Committee Member Introduction The number  has intrigued mathematicians for more than 4000 years In the pursuit of  , mathematicians have used geometry, trigonometry, algebra, calculus and probability This interaction between different branches of mathematics is one of things that makes  interesting to study This paper begins by looking at different ways of calculating  that have been used throughout history Next, it looks at the Monte Carlo method and its applications Next, a method of estimating  with Monte Carlo methods in n-dimensional space is presented The paper ends with a discussion of how the topics can be incorporated into the classroom The number  has not always had a name It wasn’t until 1706, when William Jones wrote 3.14159   , that the world had a symbol for the ratio of a circle’s circumference to its diameter Euler adopted the symbol in 1737 and it became the standard symbol The ratio of a circle’s circumference to its diameter has long been understood as a constant Then he made the molten sea; it was round, ten cubits from brim to brim, and five cubits high, and a line of thirty cubits measure its circumference (I Kings 7:23) This passage from the Bible places that constant at 30  This estimate was most 10 likely achieved through measurement, so it is quite reasonable given the likely precision of measurement An Egyptian document called the Rhind papyrus, which dates to 1650 2  8 B.C., gives a value of   , or 3.1605 It was written by a scribe named Ahmes, who  9 copied it from a document that is 200 years older Some even believe that the Rhind papyrus can trace its origin back to 3400 B.C Sets of numbers To understand what makes  special, one should look at where it fits into the realm of all numbers The number  is a transcendental number The transcendental numbers are so called because they transcend the algebraic numbers Algebraic numbers are roots of a polynomial equation of the form a0 X n  a1 X n 1  a2 X n    an 1 X  an  , where are integers For example, , an irrational number, is a solution to the quadratic equation x   Algebraic numbers also include complex numbers Using the simplest example, i is a solution of the polynomial equation x   Transcendental numbers are not the root of any integer polynomial equation In 1844, Joseph Liouville proved that transcendental numbers exist by finding examples Here is an example of one such number, called Liouville’s constant in honor of its discoverer:   10 n 1 n!  1  2!  3!   0.110001000000000000000001000 1! 10 10 10 This number contains 0’s in every place except for the n! decimal places So the 1st, 2nd, 6th, 24th, … decimal places contain 1’s The next will occur in the 5! = 120th decimal place In 1850, Liouville proved that this number cannot be a solution of a polynomial equation with integer coefficients and thus is a transcendental number The number e was proven to be transcendental in 1873 by Charles Hermite Ferdinand Lindemann used Hermite’s results to prove that  was transcendental in 1882 This proof by Lindemann also had a powerful byproduct Since  is transcendental, it follows that  cannot be the solution to a polynomial equation with integer coefficients; therefore, one of the earliest math mysteries was proven an impossibility Since antiquity, mathematicians had tried to construct a square of area equal to the area of a given circle using only a straightedge and compass Lindemann’s discovery that  is not the root of any polynomial equation proves this exercise impossible In order to this, one must construct  , which is only a possibility if  is an algebraic number With Lindemann proving that  is a transcendental number, he showed that the problem of squaring a circle was unsolvable in Euclidean geometry Archimedes’ Method of Trapping  Archimedes was the first to develop a formal approximation of  He constructed two series of polygons, one that inscribed a given circle and one that superscribed the given circle Using these polygons he created an interval for  Archimedes first showed that the area of a regular polygon is apothem perimeter An n-gon would have exactly n congruent triangles drawn from the circumcenter of the polygon to each vertex Figure shows the first three regular ngons divided into n congruent triangles Figure 1: Regular n-gons divided into n congruent triangles The area of a triangle is, of course bh When this formula is applied to one of the congruent triangles, the area of the triangle is AT  sa , where s is a side length and a is the apothem The apothem is the perpendicular distance from the center to one side of the polygon The area of the entire n-gon can be found then by multiplying this area by n , resulting in An  gon  n  sa The perimeter of a regular n-gon is just ns , so substituting results in An  gon  ap Figure helps illustrate that as n   , a  R and p  C , and therefore Acircle  RC This result was Archimedes’ formula for the area of a circle R R a a … R a Figure 2: Regular triangle, square and 30-gon with apothem and radius of the circumscribed circle marked From Euclid, Archimedes knew that the ratio of a circle’s area to the square of its diameter was a constant Let k be that constant Then k Area d2 Substituting the previous result for the area of a circle, one gets C RC  , k 4d d which results in C  4k (Linn and Neal, March 2006) d This constant 4k is of course now known as  Consider the unit circle The diameter would be and   C Using construction, one can inscribe a regular polygon of  2n sides, with semiperimeter an , and superscribe a regular polygon of  2n sides, with semiperimeter bn By constructing these regular polygons, one obtains an increasing sequence  a1 , a2 , a3 ,  and a decreasing sequence  b1 , b2 , b3 ,  such that as n  , an   and bn   This traps  between two numbers, an    bn Starting with n  , one has a regular polygon with sides, or a hexagon Choosing a point A on the circle and copying the radius, one can find two more points of the inscribed hexagon by drawing an arc centered at A Figure shows the results of this construction, points B and D Repeating this process with each resulting point as a center for the arc results in the inscribed hexagon B R A C D Figure 3: Construction of vertices of inscribed hexagon To get the superscribed hexagon, a line is constructed perpendicular to the radius at each of the vertices of the inscribed hexagon Where the perpendicular lines intersect are the vertices of the superscribed hexagon Figure illustrates the construction of one such vertex Point H is a vertex of the superscribed hexagon E B H R F A C G D Figure 4: Construction of a vertex of the superscribed hexagon Figure shows the circle with the inscribed and superscribed hexagons Figure 5: Archimedes’s first attempt at trapping  A side length in the inscribed hexagon would be So the perimeter is 6, and a1  Figure shows the length of one half-side of the inscribed hexagon expressed in terms of a trigonometric ratio Figure shows a similar result for the superscribed hexagon s =cos60°   60° R=1 Figure 6: Inscribed regular hexagon with radius and half-side length represented R=1 60° s =cot60° Figure 7: Superscribed regular hexagon with radius and half-side length represented If n is increased to 2, a dodecagon must be constructed First, one has to draw a ray from the center, O, to a vertex of the superscribed hexagon The point of intersection between this ray and the circle is a point on the inscribed dodecagon Drawing of these rays results in new points, or 12 in total These 12 points are the vertices of the inscribed dodecagon Figure illustrates the construction of one of these vertices Figure 8: Construction of a new vertex of the inscribed regular dodecagon Figure illustrates the construction of a vertex of the superscribed dodecagon First the midpoint of HC and the midpoint of GC are constructed Then two rays are drawn from the center of the circle, O, through points B and D The point of intersection uuur uuur of OB and e O is point A and the intersection of OD and e O is point E Next a line uuu r uuur perpendicular to OA is constructed through point A; the same is done for OE through point E The intersection of these two lines is point I, a vertex on the superscribed dodecagon F I E C A D G B H Figure 9: Construction of a vertex on the superscribed regular dodecagon This process can be repeated from each  2n -gon to gain vertices of the  2n1 gons In general terms an and bn can be expressed as    2n   180o   an   cos   2   2n   n    2n   180o   bn   cot   2   2n   n Using these expressions for an and bn , the first five terms of each sequence can be found an   3,3.105,3.1326,3.139,3.14103,  bn   3.464,3.2154,3.1597,3.14609,3.1427,  10 References Bohr, J (2000, August 29) Machin’s method of approximating pi Retrieved May 20, 2006, from http://ic.net/~jnbohr/java/Machin.html Buffon’s Needle (2006, April 29) Retrieved May 20, 2006, from http://en.wikipedia.org/ wiki/Buffon's_needle Clawson, C C (1996) Mathematical mysteries: The beauty and magic of numbers Cambridge, MA: Perseus Books Coexeter, H S M (1973) Regular Polytopes (3rd ed.) New York: Dover CollegeBoard AP (2006) Computer Science Course Description Accessed at http://apcentral.collegeboard.com/courses/descriptions/1,,151-162-0-8879,00.html Fuquay, J (2002) The Hypersphere Retrieved June 2, 2006, from http://www.geocities.com/jsfhome/Think4d/Hyprsphr/hsphere.html Goldstein, Platt, and Burges (n.d.) Redundant bit vectors for quickly searching highdimensional regions Microsoft Research Groleau, R (2003, September) Approximating pi Retrieved May 24, 2006, from http://www.pbs.org/wgbh/nova/archimedes/pi.html Gusmorino, P.A., III (1998) Paul’s page of pi: Gregory, Leibniz, and Machin Retrieved June 1, 2006, from http://www.escape.com/~paulg53/math/pi/greg/index.html John Machin (2006, March 12) Retrieved May 16, 2006, from http://en.wikipedia.org/ wiki/John_Machin Jovanovic, R (2005, January) Machin’s Formula Retrieved June 10, 2006, from http://milan.milanovic.org/math/english/pi/machin.html 43 Khamis, H (n.d.) Buffon’s Needle problem Retrieved June 2, 2006, from Wright State University’s Web site: http://www.math.wright.edu/People/Harry_Khamis/ buffons_needle_problem/index.htm Kunkel, P (2003, September 4) Buffon’s Needle Retrieved May 20, 2006, from http://whistleralley.com/buffon.buffon.htm Larson, Hostetler, and Edwards (2006) Calculus of a Single Variable Eighth Edition Boston, MA: Houghton Mifflin Company Linn, S., and Neal, D (2006) Approximating π with the Golden Ratio Mathematics Teacher, 99(7), 472–477 Lippert, E. (2005, May 13). High­dimensional spaces are counterintuitive, part two.  Message posted to http://blogs.msdn.com/ericlippert/archive/ 2005/05/13/417250.aspx McDonald, K T (2003, February) Volume and surface area of an N-Sphere Lecture given at Princeton University, Princeton, NJ Metropolis, N (1987) Los Alamos Science [Special issue] Monte Carlo Method (n.d.) Retrieved May 13, 2006, from http://www.riskglossary.com/link/monte_carlo_method.htm O’Connor, J J, and Robertson, E F (2001, August) A history of pi Retrieved April 30, 2006, from http://www-groups.dcs.stand.ac.uk/~history/HistTopics/Pi_through_the_ages.html Ortiz, A L (1998, February 23) Formula for the surface area of a sphere in Euclidean N-Space Retrieved May 17, 2006, from University of Waterloo David R 44 Cheriton School of Computer Science’s Web site: http://www.cs.uwaterloo.ca/~alopez-o/math-faq/node75.html Peterson, I (2003) The bias of random-number generators MAA Online Retrieved May 3, 2006, from http://www.maa.org/mathland/mathtrek%5F09%5F29%5F03.html Pilana, S (n.d.) Buffon’s Needle experiment Retrieved May 22, 2006, from http://www.geocities.com/CollegePark/Quad/2435/buffon.html Reese, G (n.d.) Buffon’s Needle: An analysis and simulation Retrieved May 22, 2006, from the Office of Mathematics, Science, and Technology Education at the University of Illinois at Urbana-Champaign’s Web site: http://www.mste.uiuc.edu/reese/buffon/buffon.html Smoller, L (2001, February) The amazing history of pi Retrieved June 3, 2006, from University of Arkansas at Little Rock Department of History’s Web site: http://www.ualr.edu/lasmoller/pi.html Weissten, E (1999) Hyperspace MathWorld—A Wolfram Web Resource Retrieved May 1, 2006 from http://mathworld.wolfram.com/Hyperspace.html Weisstein, E (1999) Machin’s Formula MathWorld—A Wolfram Web Resource Retrieved May 1, 2006 from http://mathworld.wolfram.com/MachinsFormula.html Weisstein, E (1999) Monte Carlo Method MathWorld—A Wolfram Web Resource Retrieved May 1, 2006 from http://mathworld.wolfram.com/ MonteCarloMethod.html 45 Weisstein, E (2004, January 25) Machin-like formulas MathWorld—A Wolfram Web Resource Retrieved May 3, 2006 from http://mathworld.wolfram.com/MachinLikeFormulas.html Weisstein, E (2005, December 12) Buffon’s Needle Problem MathWorld—A Wolfram Web Resource Retrieved May 7, 2006, from http://mathworld.wolfram.com/BuffonsNeedleProblem.html Weisstein, E (2006, March 15) Hypercube MathWorld—A Wolfram Web Resource Retrieved May 3, 2006 from http://mathworld.wolfram.com/Hypercube.html Weisstein, E (2006, April 17) Transcendental numbers MathWorld—A Wolfram Web Resource Retrieved May 1, 2006 from http://mathworld.wolfram.com/ TranscendentalNumbers.html Weisstein, Eric (2006, April 28) Algebraic numbers MathWorld—A Wolfram Web Resource Retrieved May 1, 2006 from http://mathworld.wolfram.com/AlgebraicNumbers.html 46 Archimedes’s Estimation of  Geometric Constructions Project Brian Reece Johnston High School brian.reece@johnston.k12.ia.us APPENDIX NCTM Standards Geometry  Analyze characteristics and properties of two-dimensional geometric shapes and develop mathematical arguments about geometric relationships  Use visualization, spatial reasoning, and geometric modeling to solve problems Archimedes was the first to formalize an approximation of  You are going to duplicate the first few steps of his method Begin by opening Geometer’s Sketchpad Construct a circle with an arbitrary radius Construct a hexagon that is inscribed inside of the circle that you constructed (You may want to hide some objects as you go) Construct a hexagon that superscribes the circle 47 Using the measurement tool of Sketchpad, calculate the semi-perimeter of each of the two hexagons that you constructed Now using what you’ve already done construct a dodecagon that is inscribed in the circle and one that superscribes the circle Calculate the semiperimeters of the two dodecagons Archimedes gave the area of a circle as Acircle  rC Using this formula for the area of a circle and the more familiar formula for the area of a circle (  r ) find an equation for  Then use the semiperimeters you found and any other information you need to find an estimate for  48 Estimating Pi through Simulation Brian Reece Johnston High School brian.reece@johnston.k12.ia.us NCTM Standards: Data Analysis and Probability  use simulations to explore the variability of sample statistics from a known population and to construct sampling distributions  use simulations to construct empirical probability distributions Geometry  use geometric models to gain insights into, and answer questions in, other areas of mathematics AP Statistics Content covered: “Law of large numbers” concept Simulation of probability distributions Large sample confidence interval for a proportion Materials needed: TI-83 or TI-84 Pencil TI-Navigator System The program SIM is distributed to students from Instructor using the TINavigator System This program is included in this handout Talk about what the calculator is doing I share the program with the class so that they realize how the process is working The calculator is selecting random xvalues between and and random y-values between and The calculator is then going to count the number of times a point is in the region bounded by the first quadrant of the x-y plane and a circle centered at the origin with a radius of Students are asked to run 10 trials of size 50 on their calculator Students are then asked to record the number of points in this bounded region for each simulation in list L4 Next students run 10 simulations of size 100 on their calculator Record the number of points in the bounded region in list L5 49 Region bounded by 1st Quadrant and a circle centered at the origin with a radius of Notice in this example that there are points outside of the region and 45 inside the region Depending on the objectives of your class there are different directions you can take at this point The handout I have included is for my AP Statistics course and uses the concept of confidence intervals This could also be used in geometry by removing the construction of confidence intervals and instead focusing on the probability of selecting a point that is inside of the bounded region (Ä/4) I also focus on the drawbacks of this process (memory, time, efficiency, etc.) 50 PROGRAM: SIM 0L 0I Disp “HOW MANY POINTS?” Prompt N rand(N)L1 rand(N)L2 ClrDraw FnOf 0Xmin 1Xmax 1Xscl 0Ymin 1Ymax 1Yscl Plot1(Scatter,L1,L2) Circle(0,0,1) Pause ((L1 - 0)2 + (L2 - 0)2)L3 For(I,1,N,1) If (L3(I) < or L3(I) = 1) Then L+1 L End End ClrHome Disp “THE NUMBER Disp “OF POINTS IN Disp “THE REGION Disp “IS Disp L 51 Estimating through Simulation Student Handout Get program SIM from Instructor The calculator is selecting random x values between and and random y-values between and The calculator is then going to count the number of times a point is in the region bounded by the first quadrant of the x-y plane and a circle centered at the origin with a radius of You are to record the number of points in this bounded region for each of ten simulations in list L4 You are going to run 10 trials of size 50 on your calculator Now run 10 simulations of size 100 on your calculator Record the number of points in the bounded region in list L5 Region bounded by 1st Quadrant and a circle centered at the origin with a radius of Notice in this example that there are points outside of the region and 45 inside the region 52 Using your 10 simulations of size 50 as one large sample of size 500, construct a 95% confidence interval for the proportion of points that can be found inside the bounded region Using your 10 simulations of size 100 as one large sample of size 1000, construct a 95% confidence interval for the proportion of points that can be found inside the bounded region Multiply the bounds of each confidence interval by What have we just estimated? Why? 53 Estimating Pi through Simulation AP Computer Science Brian Reece Johnston High School brian.reece@johnston.k12.ia.us AP Computer Science Objectives:  Design and implement computer-based solutions to problems in a variety of application areas  Use and implement well-known algorithms and data structures  Develop and select appropriate algorithms and data structures to solve problems  Code fluently in an object-oriented paradigm using the programming language Java Students are expected to be familiar with and be able to use standard Java library classes from the AP Java subset  Read and understand a large program consisting of several classes and interacting objects Students should be able to read and understand a description of the design and development process leading to such a program Specifications: Your program should  use the Random class (Built-in Java class) Review API online  use the Point class (user defined- you should already have this class)  choose n random points from [0,1) n is defined by the user  test whether the points are inside of the circle defined by the equation x  y   calculate the proportion of total points that lie inside of the circle  estimate  (Hint: Geometric probability)  Output the estimated value of   include all necessary comments Extra credit: Alter your code so that the user can define the center and the radius of the circle 54 import java.util.*; import java.io.*; public class PiEstimator { /** * Method main * * * @param args * */ public static void main(String[] args) { File file = null; long timeBefore = System.currentTimeMillis(); int repetitions =1000000; int numberOfTrials = 100; double OverallEstimate = 0; if (args.length > 0) file = new File (args[0]); if (file == null ) { System.out.println ("Default: 10_DtextOutput.txt"); file = new File ("10_DtextOutput.txt"); } try { // Create a FileWriter stream to the file FileWriter file_writer = new FileWriter (file); // Put a buffered wrapper around it BufferedWriter buf_writer = new BufferedWriter (file_writer); // In turn, wrap the PrintWriter stream around this output stream // and turn on the autoflush PrintWriter print_writer = new PrintWriter (buf_writer,true); print_writer.println("1,000,000 points in 10-D space"); print_writer.println(); for(int j=0;j

Ngày đăng: 18/10/2022, 14:12

w