The Monte Carlo Solution to Endless Iterated Integrals

45
BY: PAULANA HALL FORT VALLEY STATE UNIVERSITY From Impossible to a Split Second: The Monte Carlo Solution To Endless Iterated Integrals

Transcript of The Monte Carlo Solution to Endless Iterated Integrals

BY: PAULANA HALLFORT VALLEY STATE UNIVERSITY

From Impossible to a Split Second:

The Monte Carlo Solution To Endless Iterated Integrals

ABOUT• Atlanta, GA• Third year

student, The Fort Valley State University

• Double major: Mathematics and Computer Science

• Avid Programmer• Mother and

Engaged

CALCULUS AND STATISTICSWHO’S FAVORITE?

ANALYTICAL

f(x) = y

PROBABILITY

Theory of Sometimes

Likelihood of an outcome between 0 and 1

Probability of an event happening

=

Number of ways it can happen

Total number of outcomes

DEFINITE vs. PROBABLEHow do opposing theories relate?

LAW OF LARGE NUMBERS

•Perform a test a large number of times•Average of results are close to expected value•“Guarantees” stable results over long-term experiments•Cannot be applied to small number of trials

ROLLING A DICE 1000 TIMES

LAW OF LARGE NUMBERS

Courtesy of NYKevin

MONTE CARLO THEORYCONVERGENCE OF DEFINITIVE PROBABILITY

MONTE CARLO SIMULATION

•Used in ’30s and ‘40s by atomic physicists•Used to predict the outcome of chemical reactions•Physicists were fans of gambling•Hence name “Monte Carlo”

MODERN UTILITY

•Entities using MC:•General Motors•Procter and Gamble•Eli Lilly•Sears•National Labs (ORNL, Los Alms, etc.)•Major Wall Street Firms•Financial Planners•Engineering and Research Organizations

MODERN UTILITY

•Uncertainty Estimations•Complex Scientific Calculations•Reliability Engineering•Estimating average return•Riskiness of new products•Projecting net income•Predicting costs•Optimal capacities

THE IDEA

THE IDEA• Box off the region of integration

• Calculate the area of the box

• Randomly place points in the box

• Count number of points in the box, Nb

• Count number of points under the function, Nf

• Area of f(x) = Area of box * (Nf/Nb)

SIMPLE INTEGRALS

The Monte Carlo Technique

Mean Value Theorem

Sample f(x) uniformly xi = a + (b - a)rand()

Large number of Samples 1,000 – 10,000 – 50,000

Estimation error𝜎

√𝑁

Random Numbers

xi = a + (b - a)rand()

DOUBLE INTEGRALS

xi = a + (b - a)rand()yi = c + (d - c)rand()

TRIPLE INTEGRALS

xi = a + (b - a)rand()yi = c + (d - c)rand()zi = e + (f - e)rand()

MONTE CARLO METHOD

1.Generate random numbers for each variable

2.Evaluate them at the function

3.Average the calculated values

4.Multiply by the difference in the limits

GENERAL FORM

xni = bn + (bn - an)rand()

RANDOM POINTS

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

PROOF

WHY?

Pros•Diversify curriculum

•Alternate methods•Increase understanding

•Approach more difficult problems

Cons•Accessibility•Application•Ease of use/manipulation

EXCEL IMPLEMENTATION

xi = 1 +(3 - 1)rand()f(xi) = Xi

2 for each xi

f(xi)/N * (3-1) = final estimation

EXCEL IMPLEMENTATION

•Integral converges as samples increases

•For N = 1000: 8.76027356 vs. 8.6666 estimated actual•Error: 1.080079613 %•Not efficient for single integrals

•f(x) = x^2 + y^2•X (-2,2) Y (-2,2)

•N = 1000•Estimate: 42.725187

•Actual: 42.66666667

•Error: 0.137157187%

EXCEL IMPLEMENTATION

EXCEL IMPLEMENTATION

AUTOMATED EXCEL

EXACT INTEGRATION

MONTE CARLO INTEGRATION

Upper Lim it 1 f(x) = (x+3)/sqrt(4+(x̂ 2)) estim ate errorLower Lim it 0 actual

Error. Check your internet connection and try again. Speed: 100 Values: 1000 (M ax: 30000)x f(x) avg final error

Start Sim ulation Reset

PURPOSE

•Calculate complex, multi-dimensional integrals•

•Reduce calculations from traditional methods• Discretization of integrals• For 100 points in each integration there are 10012 =1024 calculations

• Assuming 1 Giga evaluations/sec, it would take over 107 years!

POWER OF MC

For N = 106 , there are ~106 calculations

At 1 Giga evaluations/sec it would take ~10-3 sec

CONCLUSION

•Powerful method to estimate complex integrals

•Little computational or coding effort•Does not provide exact value•Approximate values good enough for practical application

•Larger dimensional integrals can be easily calculated

•Other methods may make calculations impossible

ACKNOWLEDGEMENTS

•Fort Valley State University•FVSU Chapter of Association for Computing Machinery•Dr. Masoud Naghedolfeizi – Project Advisor•Dr. Sanjeev Arora - Grant Provider"Establishing an Undergraduate STEM Teaching and Research Laboratory at FVSU“•Dr. Dawit Aberra – FVSU Dean of Mathematics and Computer Science

QUESTIONS?COMMENTS?