DIRECT SIMULATION OR ANALOG MONTE CARLO



Similar documents
Lecture 8 : Coordinate Geometry. The coordinate plane The points on a line can be referenced if we choose an origin and a unit of 20

7.4A/7.4B STUDENT ACTIVITY #1

Julie Rotthoff Brian Ruffles. No Pi Allowed

Chapter 3 RANDOM VARIATE GENERATION

1.2 GRAPHS OF EQUATIONS. Copyright Cengage Learning. All rights reserved.

Example SECTION X-AXIS - the horizontal number line. Y-AXIS - the vertical number line ORIGIN - the point where the x-axis and y-axis cross

1.7. formulae and transposition. Introduction. Prerequisites. Learning Outcomes. Learning Style

Grade 8 Mathematics Measurement: Lesson 6

CAMI Education linked to CAPS: Mathematics

Tallahassee Community College PERIMETER

How do you compare numbers? On a number line, larger numbers are to the right and smaller numbers are to the left.

AP Physics 1. Calculating the value of Pi Example

Introduction to the Monte Carlo method

I. Pointwise convergence

Solutions to Homework 10

Circles: Circumference and Area Lesson Plans

Student Outcomes. Lesson Notes. Classwork. Exercises 1 3 (4 minutes)

Math 1B, lecture 5: area and volume

Calculator allowed. School

Notes on Continuous Random Variables

Calculation of Source-detector Solid Angle, Using Monte Carlo Method, for Radioactive Sources with Various Geometries and Cylindrical Detector

1 Functions, Graphs and Limits

of surface, , , of triangle, 548 Associative Property of addition, 12, 331 of multiplication, 18, 433

Area. Area Overview. Define: Area:

Calculating Area, Perimeter and Volume

Lecture 8. Generating a non-uniform probability distribution

Problem Set V Solutions

Irrational Numbers. A. Rational Numbers 1. Before we discuss irrational numbers, it would probably be a good idea to define rational numbers.

43 Perimeter and Area

4. How many integers between 2004 and 4002 are perfect squares?

LINEAR EQUATIONS IN TWO VARIABLES

PERIMETER AND AREA. In this unit, we will develop and apply the formulas for the perimeter and area of various two-dimensional figures.

Calculator Notes for the TI-Nspire and TI-Nspire CAS

Chapter 19. Mensuration of Sphere

ax 2 by 2 cxy dx ey f 0 The Distance Formula The distance d between two points (x 1, y 1 ) and (x 2, y 2 ) is given by d (x 2 x 1 )

Simple linear regression

Exploring Geometric Probabilities with Buffon s Coin Problem

Student Performance Q&A:

Circumference CHAPTER. 1

G C.3 Construct the inscribed and circumscribed circles of a triangle, and prove properties of angles for a quadrilateral inscribed in a circle.

Measurement with Ratios

Method of Green s Functions

PYTHAGOREAN TRIPLES KEITH CONRAD

Because the slope is, a slope of 5 would mean that for every 1cm increase in diameter, the circumference would increase by 5cm.

The Circumference Function

Copyright 2011 Casa Software Ltd. Centre of Mass

All I Ever Wanted to Know About Circles

Radius, Diameter, Circumference, π, Geometer s Sketchpad, and You! T. Scott Edge

2nd Semester Geometry Final Exam Review

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

Charlesworth School Year Group Maths Targets

TWO-DIMENSIONAL TRANSFORMATION

Vectors. Objectives. Assessment. Assessment. Equations. Physics terms 5/15/14. State the definition and give examples of vector and scalar variables.

2.1 Increasing, Decreasing, and Piecewise Functions; Applications

Mathematical Conventions Large Print (18 point) Edition

Readings this week. 1 Parametric Equations Supplement. 2 Section Sections Professor Christopher Hoffman Math 124

Math Girls Rock! Math Club for Young Women Project 2. Geometric Probability and Buffon s Needle Problem

AP CALCULUS AB 2008 SCORING GUIDELINES

Mathematical Conventions. for the Quantitative Reasoning Measure of the GRE revised General Test

Algebra II EOC Practice Test

Keystone National High School Placement Exam Math Level 1. Find the seventh term in the following sequence: 2, 6, 18, 54

MATHEMATICS Unit Pure Core 2

PROBLEM SET. Practice Problems for Exam #1. Math 1352, Fall Oct. 1, 2004 ANSWERS

Algebra II End of Course Exam Answer Key Segment I. Scientific Calculator Only

Quick Reference ebook

Solutions to old Exam 1 problems

GAP CLOSING. 2D Measurement. Intermediate / Senior Student Book

Everyday Mathematics CCSS EDITION CCSS EDITION. Content Strand: Number and Numeration

Circumference and Area of a Circle

Evaluating Trading Systems By John Ehlers and Ric Way

Trigonometric Functions: The Unit Circle

EVERY DAY COUNTS CALENDAR MATH 2005 correlated to

SAT Subject Math Level 2 Facts & Formulas

Downloaded from

Calculating the Surface Area of a Cylinder

Everyday Mathematics GOALS

Solutions to Homework 5

1.7 Graphs of Functions

Chapter 8 Geometry We will discuss following concepts in this chapter.

MODERN APPLICATIONS OF PYTHAGORAS S THEOREM

Angles and Quadrants. Angle Relationships and Degree Measurement. Chapter 7: Trigonometry

Metric Spaces. Chapter Metrics

Session 7 Circles and Pi (π)

Tennessee Mathematics Standards Implementation. Grade Six Mathematics. Standard 1 Mathematical Processes

Kristen Kachurek. Circumference, Perimeter, and Area Grades Day lesson plan. Technology and Manipulatives used:

MATH 60 NOTEBOOK CERTIFICATIONS

ALGEBRA 2/TRIGONOMETRY

SAT Subject Math Level 1 Facts & Formulas

What are the place values to the left of the decimal point and their associated powers of ten?

SURFACE AREA AND VOLUME

Trigonometric Functions and Triangles

CHAPTER 8, GEOMETRY. 4. A circular cylinder has a circumference of 33 in. Use 22 as the approximate value of π and find the radius of this cylinder.

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

Illinois State Standards Alignments Grades Three through Eleven

Applications for Triangles

Mathematics (Project Maths)

The University of the State of New York REGENTS HIGH SCHOOL EXAMINATION INTEGRATED ALGEBRA. Thursday, June 14, :15 to 4:15 p.m.

The University of the State of New York REGENTS HIGH SCHOOL EXAMINATION INTEGRATED ALGEBRA. Wednesday, June 12, :15 to 4:15 p.m.

( )( 10!12 ( 0.01) 2 2 = 624 ( ) Exam 1 Solutions. Phy 2049 Fall 2011

Transcription:

DIRECT SIMULATIO OR AALOG MOTE CARLO M. Ragheb 9/9/007 ITRODUCTIO A simple example clarifies the nature of the Monte Carlo method in its simplest unsophisticated form as a simple analog experiment, which can be carried out in close relationship to the physics involved. Suppose one is asked to determine the value of π. Several approaches can be adopted for this purpose, simpler than the Buffon eedle s approach used by Laplace. A PURE PHYSICS EXPERIMET One would get a string of, say, a length: L =100 [cm]. The string would be turned as best achievable into a circle, and the diameter of the circle is measured. Suppose that we measure the diameter to the nearest millimeter as: D = 31.8 [cm]. To calculate the value of π, we use our knowledge about the relation between the diameter D and the circumference of the circle, which is now equal to the length of the string L, as: π = L/D =100/31.8 = 3.144654088. (1) This problem can also be solved by a Monte Carlo procedure. A MOTE CARLO AALOG EXPERIMET This is a hypothetical simple experiment based on dart throwing onto a square board of side length R with a circle of radius R enclosed in it as shown in Fig. 1. We shoot darts times at the square randomly without aiming at the circle. We count the number of times n that the darts hit the circle that is enclosed in the square. If the darts throws covered the square uniformly, then from Fig. 1 we can state that: umberofhit sin circle Tota ln umberoftrials n areaofcircle πr π Limit ( ) = = = () areaofsquare 4R 4 = From Eqn. we can estimate the value of π as:

n π = 4Limit ( ) (3) Fig. 1: Analog Monte Carlo dart Experiment. From Fig. 1, an estimate of π, for a small number of experiments =16, and n=1 hits, can be estimated as: n 1 π = 4 = 4 = 3. 16 It is clear that to get a better estimate of π, we need to carry a large number of experiments. We thus seek the help of a computer. The issue is how to construct a procedure for a computer simulation of the dart throwing process. A MOTE CARLO COMPUTER EXPERIMET Consider the upper right hand quadrant of the circle in Fig.1 as shown in Fig.. Determine a uniformly distributed random point r y along the y-axis, and another one r x along the x-axis. The points r x and r y define a point in the plane: (r x, r y ). Depending on the position of the sampled point, If : d R = rx + ry, score a hit, If : d R ' ' ' = rx + ry, do not score a hit. Repeating the process times allows the computation the ratio:

umberofhits S = = umberoftrials n Fig.: Quadrant geometry in dart throwing experiment. From Fig., this quantity is the ratio of the area of the circular quadrant to the area of the fourth of the square and satisfies the relationship: From Eqn. 4 an estimate of π can be obtained as: MOTE CARLO PROCEDURE πr ( ) n 4 π S = = = (4) (R) 4 4 n π = 4 S = 4 (5) The flow chart of the algorithm for the computer simulation of the process of darts throwing is shown in Fig.3, and the listing of the corresponding algorithm is shown in Fig.4. Two counters for the number of hits and the number of trials are initialized to zero. A point in the square is uniformly sampled. If a test of its position implies a hit, the hit counter is incremented. Another test checks the total n umber of trials. When the maximum number of assigned trials is reached, the value of π is calculated, the results displayed and written on the screen, and the computation is stopped.

Fig.3: Flow Chart for dart throwing problem.! darts_throwing.f90! Monte Carlo Simulation of darts throwing at a circle enclosed! in a square to estimate the value of pi! M. Ragheb, Univ. of Illinois at Urbana-Champaign!

program darts_throwing real(8) x_coordinate,y_coordinate,hits,pi,trials real(8) circle_radius,circle_radius_square,position_square! Initialization of variables trials = 1.0E+09 ntrials=trials square_side_length =.0 circle_radius = square_side_length /.0 circle_radius_square=circle_radius*circle_radius! Simulation of darts throwing do i = 1,ntrials call random (rr) x_coordinate = circle_radius * rr call random (rr) y_coordinate = circle_radius * rr position_square = ( x_coordinate * x_coordinate + & & y_coordinate * y_coordinate ) if (position_square.le. circle_radius_square) then! Score a hit hits = hits + 1.0 endif end do! Estimate value of pi pi = 4.0 * hits / trials! Print results print *,' Trials Hits Pi ' print *,'------------------------------------------' print '(3(E15.8,x))',trials, hits, pi end Fig.4: Listing of Monte Carlo procedure for dart throwing problem. Table 1: Comparison of estimates of the value of π, for different numbers of throws. DISCUSSIO umber of trials, Estimate of π Laplace s Buffon eedle Monte Carlo Estimate of π Darts throwing, Analog Monte Carlo. 10 1 4.999999.8000000 10 3.703704 3.300000 10 3 3.194888 3.1480000 10 4 3.193868 3.1344000 10 5 3.14736 3.1474000 10 6 3.138978 3.144680 10 7 3.140663 3.145804 10 8 3.14130 3.141661 10 9 3.14168 3.1416093

This simple problem shows how a Monte Carlo Procedure involves several distinct basic steps: 1. The definition of an analog numerical experiment equivalent to the physical experiment that we would like to perform.. Sampling a distribution function, here a uniform distribution, using random numbers. 3. Estimation of parameters over the performed experiment to determine the quantities of interest. Estimates of the value of π calculated with the dart-throwing algorithm are shown in Table 1 for different numbers of experiments or trials. These results are compared to those obtained from the Pascal s Buffon eedle algorithm reported earlier. EXERCISES 1. Plot the convergence of the value of π, as well as the absolute relative error in the estimate as becomes larger. Compare the estimates of π as a function of to those obtained by using the Pascal s Buffon eedle approach. Does the error decrease as the predicted the inverse square root of the number of trials?. Vary the size of the circle and square in the simulation. Does that affect the estimates?