This book is intended for undergraduate students of Mathematics, Statistics, and Physics who know nothing about Monte Ca
790 188 5MB
English Pages 133 [135] Year 2021
Table of contents :
Introduction
Random Variable
Continuous Random Variable
Uniform Random Variable
Normal or Gaussian Random Variable
Transformation or Modeling of Random Variable
Examples of Transformation or Modeling of Random Variable
Variance Reduction and Importance Sampling
Evaluation of Definite Integrals Using the Monte Carlo Method
Evaluation of Definite Integrals Using the Monte Carlo Method: Example I
Evaluation of Definite Integrals Using the Monte Carlo Method: Example II
Evaluation of Definite Integrals Using the Monte Carlo Method: Example III
Evaluation of Definite Integrals Using the Monte Carlo Method: Example IV
Evaluation of Definite Integrals Using the Monte Carlo Method: Example V
Variational Monte Carlo Method Applied to the Ground State of a Simple Harmonic Oscillator
The Variational Method of Quantum Mechanics Applied to the Ground State of Any Quantum Mechanical System
The Variational Method of Quantum Mechanics Applied to the Ground State of a Simple Harmonic Oscillator
Ground State Energy of a Simple Harmonic Oscillator Using the Monte Carlo Method
Variational Monte Carlo Method Applied to the Ground State of a Hydrogen Atom
The Variational Method of Quantum Mechanics Applied to the Ground State of Any Quantum Mechanical System (again)
The Variational Method of Quantum Mechanics Applied to the Ground State of a Hydrogen Atom
Ground State Energy of a Hydrogen Atom Using the Variational Monte Carlo Method
Concluding Remarks
Bibliography
Author's Biography
Blank Page
ℝ
Series ISSN: 1938-1743
Sujaul Chowdhury, Shahjalal University of Science and Technology
MONTE CARLO METHODS
This book is intended for undergraduate students of Mathematics, Statistics, and Physics who know nothing about Monte Carlo Methods but wish to know how they work. All treatments have been done as much manually as is practicable. The treatments are deliberately manual to let the readers get the real feel of how Monte Carlo Methods work. Definite integrals of a total of five functions F(x), namely Sin(x), Cos(x), ex, loge(x), and 1/(1+x2), have been evaluated using constant, linear, Gaussian, and exponential probability density functions p(x). It is shown that results agree with known exact values better if p(x) is proportional to F(x). Deviation from the proportionality results in worse agreement. Two separate chapters have been dedicated to Variational Quantum Monte Carlo method applied to ground state of simple harmonic oscillator and of Hydrogen atom. The book is intended to aid hands-on learning of Monte Carlo method.
Monte Carlo Methods A Hands-On Computational Introduction Utilizing Excel
CHOWDHURY
Series Editor: Steven G. Krantz, Washington University in St. Louis
About SYNTHESIS
store.morganclaypool.com
MORGAN & CLAYPOOL
This volume is a printed version of a work that appears in the Synthesis Digital Library of Engineering and Computer Science. Synthesis books provide concise, original presentations of important research and development topics, published quickly, in digital and print formats.
Monte Carlo Methods A Hands-On Computational Introduction Utilizing Excel Sujaul Chowdhury
Monte Carlo Methods A Hands-On Computational Introduction Utilizing Excel
Synthesis Lectures on Mathematics and Statistics Editor Steven G. Krantz, Washington University, St. Louis
Monte Carlo Methods: A Hands-On Computational Introduction Utilizing Excel Sujaul Chowdhury 2021
Crowd Dynamics by Kinetic Theory Modeling: Complexity, Modeling, Simulations, and Safety Bouchra Aylaj, Nicola Bellomo, Livio Gibelli, and Damián Knopoff 2020
Probability and Statistics for STEM: A Course in One Semester E.N. Barron and J.G. Del Greco 2020
An Introduction to Proofs with Set Theory Daniel Ashlock and Colin Lee 2020
Discrete Distributions in Engineering and Applied Sciences Rajan Chattamvelli and Ramalingam Shanmugam 2020
Affine Arithmetic Based Solution of Uncertain Static and Dynamic Problems Snehashish Chakraverty and Saudamini Rout 2020
Time Fractional Order Biological Systems with Uncertain Parameters Snehashish Chakraverty, Rajarama Mohan Jena, and Subrat Kumar Jena 2020
Fast Start Advanced Calculus Daniel Ashlock 2019
iii
Fast Start Integral Calculus Daniel Ashlock 2019
Fast Start Differential Calculus Daniel Ashlock 2019
Introduction to Statistics Using R Mustapha Akinkunmi 2019
Inverse Obstacle Scattering with Non-Over-Determined Scattering Data Alexander G. Ramm 2019
Analytical Techniques for Solving Nonlinear Partial Differential Equations Daniel J. Arrigo 2019
Aspects of Differential Geometry IV Esteban Calviño-Louzao, Eduardo García-Río, Peter Gilkey, JeongHyeong Park, and Ramón Vázquez-Lorenzo 2019
Symmetry Problems. The Navier–Stokes Problem. Alexander G. Ramm 2019
An Introduction to Partial Differential Equations Daniel J. Arrigo 2017
Numerical Integration of Space Fractional Partial Differential Equations: Vol 2 – Applicatons from Classical Integer PDEs Younes Salehi and William E. Schiesser 2017
Numerical Integration of Space Fractional Partial Differential Equations: Vol 1 – Introduction to Algorithms and Computer Coding in R Younes Salehi and William E. Schiesser 2017
Aspects of Differential Geometry III Esteban Calviño-Louzao, Eduardo García-Río, Peter Gilkey, JeongHyeong Park, and Ramón Vázquez-Lorenzo 2017
iv
The Fundamentals of Analysis for Talented Freshmen Peter M. Luthy, Guido L. Weiss, and Steven S. Xiao 2016
Aspects of Differential Geometry II Peter Gilkey, JeongHyeong Park, Ramón Vázquez-Lorenzo 2015
Aspects of Differential Geometry I Peter Gilkey, JeongHyeong Park, Ramón Vázquez-Lorenzo 2015
An Easy Path to Convex Analysis and Applications Boris S. Mordukhovich and Nguyen Mau Nam 2013
Applications of Affine and Weyl Geometry Eduardo García-Río, Peter Gilkey, Stana Nikčević, and Ramón Vázquez-Lorenzo 2013
Essentials of Applied Mathematics for Engineers and Scientists, Second Edition Robert G. Watts 2012
Chaotic Maps: Dynamics, Fractals, and Rapid Fluctuations Goong Chen and Yu Huang 2011
Matrices in Engineering Problems Marvin J. Tobias 2011
The Integral: A Crux for Analysis Steven G. Krantz 2011
Statistics is Easy! Second Edition Dennis Shasha and Manda Wilson 2010
Lectures on Financial Mathematics: Discrete Asset Pricing Greg Anderson and Alec N. Kercheval 2010
Jordan Canonical Form: Theory and Practice Steven H. Weintraub 2009
v
The Geometry of Walker Manifolds Miguel Brozos-Vázquez, Eduardo García-Río, Peter Gilkey, Stana Nikčević, and Ramón Vázquez-Lorenzo 2009
An Introduction to Multivariable Mathematics Leon Simon 2008
Jordan Canonical Form: Application to Differential Equations Steven H. Weintraub 2008
Statistics is Easy! Dennis Shasha and Manda Wilson 2008
A Gyrovector Space Approach to Hyperbolic Geometry Abraham Albert Ungar 2008
Copyright © 2021 by Morgan & Claypool
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means—electronic, mechanical, photocopy, recording, or any other except for brief quotations in printed reviews, without the prior permission of the publisher. Monte Carlo Methods: A Hands-On Computational Introduction Utilizing Excel Sujaul Chowdhury www.morganclaypool.com ISBN: 9781636390710 ISBN: 9781636390727 ISBN: 9781636390734
paperback ebook hardcover
DOI 10.2200/S01073ED1V01Y202101MAS037
A Publication in the Morgan & Claypool Publishers series SYNTHESIS LECTURES ON MATHEMATICS AND STATISTICS Lecture #37 Series Editor: Steven G. Krantz, Washington University, St. Louis Series ISSN Print 1938-1743 Electronic 1938-1751
Monte Carlo Methods A Hands-On Computational Introduction Utilizing Excel
Sujaul Chowdhury Shahjalal University of Science and Technology
SYNTHESIS LECTURES ON MATHEMATICS AND STATISTICS #37
M &C
Morgan
& cLaypool publishers
ABSTRACT This book is intended for undergraduate students of Mathematics, Statistics, and Physics who know nothing about Monte Carlo Methods but wish to know how they work. All treatments have been done as much manually as is practicable. The treatments are deliberately manual to let the readers get the real feel of how Monte Carlo Methods work. Definite integrals of a total of five functions F .x/, namely Sin.x/, Cos.x/, ex , loge .x/, and 1=.1 C x 2 /, have been evaluated using constant, linear, Gaussian, and exponential probability density functions p.x/. It is shown that results agree with known exact values better if p.x/ is proportional to F .x/. Deviation from the proportionality results in worse agreement. This book is on Monte Carlo Methods which are numerical methods for Computational Physics. These are parts of a syllabus for undergraduate students of Mathematics and Physics for the course titled “Computational Physics.” Need for the book: Besides the three referenced books, this is the only book that teaches how basic Monte Carlo methods work. This book is much more explicit and easier to follow than the three referenced books. The two chapters on the Variational Quantum Monte Carlo method are additional contributions of the book. Pedagogical features: After a thorough acquaintance with background knowledge in Chapter 1, five thoroughly worked out examples on how to carry out Monte Carlo integration is included in Chapter 2. Moreover, the book contains two chapters on the Variational Quantum Monte Carlo method applied to a simple harmonic oscillator and a hydrogen atom. The book is a good read; it is intended to make readers adept at using the method. The book is intended to aid in hands-on learning of the Monte Carlo methods.
KEYWORDS Monte Carlo methods, basic Monte Carlo integration, variational quantum Monte Carlo method, simple harmonic oscillator, hydrogen atom
ix
Contents 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7
2
Evaluation of Definite Integrals Using the Monte Carlo Method . . . . . . . . . . . 37 2.1 2.2 2.3 2.4 2.5
3
Evaluation of Definite Integrals Using the Monte Carlo Method: Example I Evaluation of Definite Integrals Using the Monte Carlo Method: Example II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Evaluation of Definite Integrals Using the Monte Carlo Method: Example III . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Evaluation of Definite Integrals Using the Monte Carlo Method: Example IV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Evaluation of Definite Integrals Using the Monte Carlo Method: Example V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37 44 66 70 75
Variational Monte Carlo Method Applied to the Ground State of a Simple Harmonic Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3.1 3.2 3.3
4
Random Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Continuous Random Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Uniform Random Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Normal or Gaussian Random Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Transformation or Modeling of Random Variable . . . . . . . . . . . . . . . . . . . . . . . 2 Examples of Transformation or Modeling of Random Variable . . . . . . . . . . . . 5 Variance Reduction and Importance Sampling . . . . . . . . . . . . . . . . . . . . . . . . . 32
The Variational Method of Quantum Mechanics Applied to the Ground State of Any Quantum Mechanical System . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 The Variational Method of Quantum Mechanics Applied to the Ground State of a Simple Harmonic Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Ground State Energy of a Simple Harmonic Oscillator Using the Monte Carlo Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Variational Monte Carlo Method Applied to the Ground State of a Hydrogen Atom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
x
4.1 4.2 4.3
5
The Variational Method of Quantum Mechanics Applied to the Ground State of Any Quantum Mechanical System (again) . . . . . . . . . . . . . . . . . . . . 107 The Variational Method of Quantum Mechanics Applied to the Ground State of a Hydrogen Atom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Ground State Energy of a Hydrogen Atom Using the Variational Monte Carlo Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Concluding Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Author’s Biography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
1
CHAPTER
1
Introduction 1.1
RANDOM VARIABLE
In layman terms, a random variable refers to a variable the value of which is not predictable. We do not know what value the variable can or will assume. In connection with the Monte Carlo method, the term “random variable” has a precise meaning. We do not know the value of the variable in any given case, but we do know the values that the variable can assume and the probabilities of these values. The result of a single trial cannot be precisely predicted, but the result of a large number of trials can be predicted very reliably. To define a random variable, we must indicate the values that the variable can assume and the probabilities of occurrence of these values.
1.2
CONTINUOUS RANDOM VARIABLE
A random variable x is called “continuous” if it can assume any (fractional) value in a certain interval, say a to b . Besides specifying the interval containing all its possible values, we need to state a function p.x/ called probability density function or probability distribution function. We have: 1. p.x/ 0 for a x b , 2. the product p.x/dx is probability that x x x C dx , R b0 3. a0 p.x/dx is probability that a0 x b 0 where a < a0 and b 0 < b , and Rb 4. a p.x/dx D 1 indicating the surety that x lies in the interval a to b . As such, the average or so-called expectation value of x is given by Ax D Rb and average value of any function of x , say f .x/, is Af D a f .x/p.x/dx .
1.3
Rb a
xp.x/dx ,
UNIFORM RANDOM VARIABLE
A random variable u in the interval 0 x 1 having constant, say C , probability density funcR1 tion p.x/ D C is said to be a uniform random variable. The requirement that 0 p.x/dx D 1 R1 gives 0 Cdx D 1 which gives C D 1. Thus, probability density function of uniform random variable is p.x/ D 1.
2
1. INTRODUCTION
Here is a manual way of obtaining values of a uniform random variable. Take ten table tennis balls; write on each of them one of the ten digits 0, 1, 2, 3, …, 9; mingle them well in a box; take one ball out and note the digit; place the ball back to the box and mingle the ten balls well again; then take one ball out and note the digit. Continue the process until we get a table of 300 digits. From this table, take a sequence of three digits, say 1, 6, 9; construct the number 169; then divide the number by 1000 and get 0.169. Repeat the process until we get a list of 100 numbers such as 0.169. Thus, we have a table of 100 numbers in the interval 0 to 1. Since each of the digits 0, 1, 2, 3, …, 9 was equally likely to be picked up during the trials, the said 100 numbers are uniformly distributed in the interval 0 to 1. Thus, we have 100 values of uniform random variable u. See Table 1.1.
1.4
NORMAL OR GAUSSIAN RANDOM VARIABLE
Probability density function p.x/ for normal random variable x is given by p.x/ D
1 p Exp 2
1 x a 2 ; 2
(1.1)
defined for /< x < C /. The average value of x is a and variance of x is 2 . According to R aC3 the so-called rule of 3 sigma, a 3 p.x/dx 0:997.
1.5
TRANSFORMATION OR MODELING OF RANDOM VARIABLE
Values of random variable corresponding to a given probability density function p.x/ defined for a x b can be obtained by transformation of values of one “standard” random variable which is usually taken as the uniform random variable u (distributed in the interval 0 x 1). See Table 1.1. We already know the values of u. The process of finding the values of by transforming the values of u is called modeling or transformation of the random variable. With every available value of u, the corresponding value of is obtainable by solving the equation Z a
p.x/dx D u:
(1.2)
This is verified below. Here values of are distributed in the interval a x b with probability density function p.x/. Let Z x y.x/ D p.x/dx: (1.3) a
1.5. TRANSFORMATION OR MODELING OF RANDOM VARIABLE
Table 1.1: Showing 100 uniform random numbers ui (in the interval 0–1) i
ui
i
ui
i
ui
i
ui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
3
4
1. INTRODUCTION
y 1 y(b′) y(a′) Q
u
(0, 0)
a
a′ b′
η
b
x
Figure 1.1: Figure to help explain transformation or modeling of random variable.
Since p.x/ > 0, and
Rb a
p.x/dx D 1, we have y.a/ D y.b/ D
Z
a
p.x/dx D 0
a
Z
a
b
p.x/dx D 1
emphasizing that p.x/ is normalized, and y 0 .x/ D p.x/ > 0:
This means that y monotonically increases from 0 to 1 for the interval a < x < b . See Figure 1.1. Straight line y D u where 0 < R u < 1 intersects the curve y.x/ at Q giving us the value of which satisfies Equation (1.2): a p.x/dx D u. p.a0 < < b 0 / D p.y.a0 / < u < y.b 0 // D y.b 0 / y.a0 / Z b0 Z a0 Z b0 D p.x/dx p.x/dx D p.x/dx: a
a0
a
Thus, random variable which obeys Equation (1.2): function p.x/.
R a
p.x/dx D u has the probability density
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
1.6
EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
Values of random variable obeying normalized, arbitrary probability density function p.x/ in R the interval a < x < b are obtainable from Equation (1.2): a p.x/dx D u where u is uniform random variable in the interval 0 to 1. Values of random variable uniformly distributed in the interval a < x < b R Rb are obtainable from a C dx D u where p.x/ should be normalized, i.e., a p.x/dx D 1, Rb R a/. Thus, a b 1 a dx D u. Hence, a Cdx D 1, C D 1=.b
Example 1.1
D a C .b
a/u:
(1.4)
This is a linear transformation of u. Use of tabulated values of u (see Table 1.1) in Equation (1.4) gives us values of random variable obeying uniform probability density function p.x/ D 1=.b a/ in the interval a < x < b . See Table 1.2 which shows 100 uniform random numbers i in the interval =2 to C=2 obtained using Equation (1.4): D a C .b a/u which gives i ’s as a linear transformation of ui ’s. We now discuss modeling of random variable g obeying Gaussian or normal probability density function given by 1 1 x a 2 pg .xI a D 0; D 1/ D p Exp : (1.5) 2 2 R with p given by Equation (1.5) Values of g are obtainable from Equation (1.2): a hp.x/dx D u 2 i Rg 1 1 x a with a D 0 and D 1, i.e., from a 3 p2 Exp 2 dx D u with a D 0 and D 1, i.e., from Z g 1 2 1 x dx D u: (1.6) p Exp 2 2 3 But Equation (1.6) is not analytically solvable such, we have used Program 1.3 in R for g . As Mathematica 6.0 and obtained values of 3 p12 Exp 12 x 2 dx for ranging from 3 to in step of 0.005. According to Equation (1.6), values of g are those values of for which RC3 1 2 p1 x dx D u. Hence, we have literally and manually hunted for each value of u 3 2 Exp 2 of Table 1.1 in the 3rd and 6th columns of Table 1.3 and wrote down the corresponding value of from the 2nd and 5th columns of Table 1.3 in Table 1.4. Example 1.2
5
6
1. INTRODUCTION
Table 1.2: Showing 100 uniform random numbers i in the interval =2 to C=2 obtained using Equation (1.4): D a C .b a/u which gives i ’s as linear transformation of ui ’s i
ui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
ηi = −π/2 + πui i –1.040 –1.414 1.081 –0.999 0.311 1.524 0.710 –1.106 0.905 0.622 –1.539 –0.324 1.106 0.820 –0.600 –1.216 –0.905 0.971 –1.307 –0.704 –0.807 1.536 0.025 0.996 –1.024
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui 0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
ηi = −π/2 + πui i –0.864 0.587 –1.382 –1.351 1.052 –0.107 –0.719 0.983 –0.390 1.517 –1.002 0.261 0.352 –0.101 0.358 0.842 0.977 –0.123 1.524 0.738 0.185 1.206 –0.851 1.319 0.075
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui
ηi = −π/2 + πui
i
ui
ηi = −π/2 + πui
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
–0.336 –0.609 1.002 0.377 1.178 0.858 –0.025 –0.528 –0.990 0.204 –0.207 0.518 0.050 0.500 0.657 0.047 0.575 –1.282 –0.261 0.308 0.572 1.407 –1.178 –1.103 –0.798
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
–0.845 1.056 –1.046 0.141 0.779 –0.188 0.547 –0.669 –1.407 1.382 0.562 1.288 –0.773 –0.829 1.112 1.184 –0.053 –1.203 1.090 –0.939 –0.647 –1.348 –1.367 0.754 1.426
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
R Table 1.3: Showing values of 3 p12 Exp 12 x 2 dx for ranging from 3 to C3 in step of 0.005. Tabulated using Program 1.3 via Microsoft Excel. η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 0.001 0.001 0.001 0.001
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
η
–3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
–3.000 –2.995 –2.990 –2.985 –2.980 –2.975 –2.970 –2.965 –2.960 –2.955 –2.950 –2.945 –2.940 –2.935 –2.930 –2.925 –2.920 –2.915 –2.910 –2.905 –2.900 –2.895 –2.890 –2.885 –2.880
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–2.875 –2.870 –2.865 –2.860 –2.855 –2.850 –2.845 –2.840 –2.835 –2.830 –2.825 –2.820 –2.815 –2.810 –2.805 –2.800 –2.795 –2.790 –2.785 –2.780 –2.775 –2.770 –2.765 –2.760 –2.755
0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.002 0.002
7
8
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.003 0.003 0.003 0.003 0.003 0.003 0.003
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
η
–3
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
–2.750 –2.745 –2.740 –2.735 –2.730 –2.725 –2.720 –2.715 –2.710 –2.705 –2.700 –2.695 –2.690 –2.685 –2.680 –2.675 –2.670 –2.665 –2.660 –2.655 –2.650 –2.645 –2.640 –2.635 –2.630
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–2.625 –2.620 –2.615 –2.610 –2.605 –2.600 –2.595 –2.590 –2.585 –2.580 –2.575 –2.570 –2.565 –2.560 –2.555 –2.550 –2.545 –2.540 –2.535 –2.530 –2.525 –2.520 –2.515 –2.510 –2.505
0.003 0.003 0.003 0.003 0.003 0.003 0.003 0.003 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.004 0.005 0.005 0.005 0.005
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.005 0.005 0.005 0.005 0.005 0.005 0.005 0.006 0.006 0.006 0.006 0.006 0.006 0.006 0.006 0.006 0.006 0.007 0.007 0.007 0.007 0.007 0.007 0.007 0.007
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
η
–3
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
–2.500 –2.495 –2.490 –2.485 –2.480 –2.475 –2.470 –2.465 –2.460 –2.455 –2.450 –2.445 –2.440 –2.435 –2.430 –2.425 –2.420 –2.415 –2.410 –2.405 –2.400 –2.395 –2.390 –2.385 –2.380
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–2.375 –2.370 –2.365 –2.360 –2.355 –2.350 –2.345 –2.340 –2.335 –2.330 –2.325 –2.320 –2.315 –2.310 –2.305 –2.300 –2.295 –2.290 –2.285 –2.280 –2.275 –2.270 –2.265 –2.260 –2.255
0.007 0.008 0.008 0.008 0.008 0.008 0.008 0.008 0.008 0.009 0.009 0.009 0.009 0.009 0.009 0.009 0.010 0.010 0.010 0.010 0.010 0.010 0.010 0.011 0.011
9
10
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.011 0.011 0.011 0.011 0.012 0.012 0.012 0.012 0.012 0.012 0.013 0.013 0.013 0.013 0.013 0.013 0.014 0.014 0.014 0.014 0.014 0.015 0.015 0.015 0.015
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
η
–3
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
–2.250 –2.245 –2.240 –2.235 –2.230 –2.225 –2.220 –2.215 –2.210 –2.205 –2.200 –2.195 –2.190 –2.185 –2.180 –2.175 –2.170 –2.165 –2.160 –2.155 –2.150 –2.145 –2.140 –2.135 –2.130
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–2.125 –2.120 –2.115 –2.110 –2.105 –2.100 –2.095 –2.090 –2.085 –2.080 –2.075 –2.070 –2.065 –2.060 –2.055 –2.050 –2.045 –2.040 –2.035 –2.030 –2.025 –2.020 –2.015 –2.010 –2.005
0.015 0.016 0.016 0.016 0.016 0.017 0.017 0.017 0.017 0.017 0.018 0.018 0.018 0.018 0.019 0.019 0.019 0.019 0.020 0.020 0.020 0.020 0.021 0.021 0.021
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.021 0.022 0.022 0.022 0.023 0.023 0.023 0.023 0.024 0.024 0.024 0.025 0.025 0.025 0.025 0.026 0.026 0.026 0.027 0.027 0.027 0.028 0.028 0.028 0.029
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
η
–3
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
–2.000 –1.995 –1.990 –1.985 –1.980 –1.975 –1.970 –1.965 –1.960 –1.955 –1.950 –1.945 –1.940 –1.935 –1.930 –1.925 –1.920 –1.915 –1.910 –1.905 –1.900 –1.895 –1.890 –1.885 –1.880
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–1.875 –1.870 –1.865 –1.860 –1.855 –1.850 –1.845 –1.840 –1.835 –1.830 –1.825 –1.820 –1.815 –1.810 –1.805 –1.800 –1.795 –1.790 –1.785 –1.780 –1.775 –1.770 –1.765 –1.760 –1.755
0.029 0.029 0.030 0.030 0.030 0.031 0.031 0.032 0.032 0.032 0.033 0.033 0.033 0.034 0.034 0.035 0.035 0.035 0.036 0.036 0.037 0.037 0.037 0.038 0.038
11
12
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.039 0.039 0.040 0.040 0.040 0.041 0.041 0.042 0.042 0.043 0.043 0.044 0.044 0.045 0.045 0.046 0.046 0.047 0.047 0.048 0.048 0.049 0.049 0.050 0.050
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
η
–3
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
–1.750 –1.745 –1.740 –1.735 –1.730 –1.725 –1.720 –1.715 –1.710 –1.705 –1.700 –1.695 –1.690 –1.685 –1.680 –1.675 –1.670 –1.665 –1.660 –1.655 –1.650 –1.645 –1.640 –1.635 –1.630
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–1.625 –1.620 –1.615 –1.610 –1.605 –1.600 –1.595 –1.590 –1.585 –1.580 –1.575 –1.570 –1.565 –1.560 –1.555 –1.550 –1.545 –1.540 –1.535 –1.530 –1.525 –1.520 –1.515 –1.510 –1.505
0.051 0.051 0.052 0.052 0.053 0.053 0.054 0.055 0.055 0.056 0.056 0.057 0.057 0.058 0.059 0.059 0.060 0.060 0.061 0.062 0.062 0.063 0.064 0.064 0.065
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.065 0.066 0.067 0.067 0.068 0.069 0.069 0.070 0.071 0.071 0.072 0.073 0.074 0.074 0.075 0.076 0.076 0.077 0.078 0.079 0.079 0.080 0.081 0.082 0.082
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
η
–3
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
–1.500 –1.495 –1.490 –1.485 –1.480 –1.475 –1.470 –1.465 –1.460 –1.455 –1.450 –1.445 –1.440 –1.435 –1.430 –1.425 –1.420 –1.415 –1.410 –1.405 –1.400 –1.395 –1.390 –1.385 –1.380
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–1.375 –1.370 –1.365 –1.360 –1.355 –1.350 –1.345 –1.340 –1.335 –1.330 –1.325 –1.320 –1.315 –1.310 –1.305 –1.300 –1.295 –1.290 –1.285 –1.280 –1.275 –1.270 –1.265 –1.260 –1.255
0.083 0.084 0.085 0.086 0.086 0.087 0.088 0.089 0.090 0.090 0.091 0.092 0.093 0.094 0.095 0.095 0.096 0.097 0.098 0.099 0.100 0.101 0.102 0.102 0.103
13
14
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.104 0.105 0.106 0.107 0.108 0.109 0.110 0.111 0.112 0.113 0.114 0.115 0.116 0.117 0.118 0.119 0.120 0.121 0.122 0.123 0.124 0.125 0.126 0.127 0.128
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
η
–3
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
–1.250 –1.245 –1.240 –1.235 –1.230 –1.225 –1.220 –1.215 –1.210 –1.205 –1.200 –1.195 –1.190 –1.185 –1.180 –1.175 –1.170 –1.165 –1.160 –1.155 –1.150 –1.145 –1.140 –1.135 –1.130
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–1.125 –1.120 –1.115 –1.110 –1.105 –1.100 –1.095 –1.090 –1.085 –1.080 –1.075 –1.070 –1.065 –1.060 –1.055 –1.050 –1.045 –1.040 –1.035 –1.030 –1.025 –1.020 –1.015 –1.010 –1.005
0.129 0.130 0.131 0.132 0.133 0.134 0.135 0.137 0.138 0.139 0.140 0.141 0.142 0.143 0.144 0.146 0.147 0.148 0.149 0.150 0.151 0.153 0.154 0.155 0.156
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.157 0.159 0.160 0.161 0.162 0.163 0.165 0.166 0.167 0.168 0.170 0.171 0.172 0.174 0.175 0.176 0.177 0.179 0.180 0.181 0.183 0.184 0.185 0.187 0.188
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
η
–3
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
–1.000 –0.995 –0.990 –0.985 –0.980 –0.975 –0.970 –0.965 –0.960 –0.955 –0.950 –0.945 –0.940 –0.935 –0.930 –0.925 –0.920 –0.915 –0.910 –0.905 –0.900 –0.895 –0.890 –0.885 –0.880
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–0.875 –0.870 –0.865 –0.860 –0.855 –0.850 –0.845 –0.840 –0.835 –0.830 –0.825 –0.820 –0.815 –0.810 –0.805 –0.800 –0.795 –0.790 –0.785 –0.780 –0.775 –0.770 –0.765 –0.760 –0.755
0.189 0.191 0.192 0.194 0.195 0.196 0.198 0.199 0.201 0.202 0.203 0.205 0.206 0.208 0.209 0.211 0.212 0.213 0.215 0.216 0.218 0.219 0.221 0.222 0.224
15
16
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.225 0.227 0.228 0.230 0.231 0.233 0.234 0.236 0.238 0.239 0.241 0.242 0.244 0.245 0.247 0.248 0.250 0.252 0.253 0.255 0.256 0.258 0.260 0.261 0.263
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
η
–3
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
–0.750 –0.745 –0.740 –0.735 –0.730 –0.725 –0.720 –0.715 –0.710 –0.705 –0.700 –0.695 –0.690 –0.685 –0.680 –0.675 –0.670 –0.665 –0.660 –0.655 –0.650 –0.645 –0.640 –0.635 –0.630
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–0.625 –0.620 –0.615 –0.610 –0.605 –0.600 –0.595 –0.590 –0.585 –0.580 –0.575 –0.570 –0.565 –0.560 –0.555 –0.550 –0.545 –0.540 –0.535 –0.530 –0.525 –0.520 –0.515 –0.510 –0.505
0.265 0.266 0.268 0.270 0.271 0.273 0.275 0.276 0.278 0.280 0.281 0.283 0.285 0.286 0.288 0.290 0.292 0.293 0.295 0.297 0.298 0.300 0.302 0.304 0.305
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.307 0.309 0.311 0.312 0.314 0.316 0.318 0.320 0.321 0.323 0.325 0.327 0.329 0.330 0.332 0.334 0.336 0.338 0.340 0.341 0.343 0.345 0.347 0.349 0.351
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
η
–3
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525
–0.500 –0.495 –0.490 –0.485 –0.480 –0.475 –0.470 –0.465 –0.460 –0.455 –0.450 –0.445 –0.440 –0.435 –0.430 –0.425 –0.420 –0.415 –0.410 –0.405 –0.400 –0.395 –0.390 –0.385 –0.380
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–0.375 –0.370 –0.365 –0.360 –0.355 –0.350 –0.345 –0.340 –0.335 –0.330 –0.325 –0.320 –0.315 –0.310 –0.305 –0.300 –0.295 –0.290 –0.285 –0.280 –0.275 –0.270 –0.265 –0.260 –0.255
0.352 0.354 0.356 0.358 0.360 0.362 0.364 0.366 0.367 0.369 0.371 0.373 0.375 0.377 0.379 0.381 0.383 0.385 0.386 0.388 0.390 0.392 0.394 0.396 0.398
17
18
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.400 0.402 0.404 0.406 0.408 0.410 0.412 0.414 0.415 0.417 0.419 0.421 0.423 0.425 0.427 0.429 0.431 0.433 0.435 0.437 0.439 0.441 0.443 0.445 0.447
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
η
–3
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
–0.250 –0.245 –0.240 –0.235 –0.230 –0.225 –0.220 –0.215 –0.210 –0.205 –0.200 –0.195 –0.190 –0.185 –0.180 –0.175 –0.170 –0.165 –0.160 –0.155 –0.150 –0.145 –0.140 –0.135 –0.130
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
–0.125 –0.120 –0.115 –0.110 –0.105 –0.100 –0.095 –0.090 –0.085 –0.080 –0.075 –0.070 –0.065 –0.060 –0.055 –0.050 –0.045 –0.040 –0.035 –0.030 –0.025 –0.020 –0.015 –0.010 –0.005
0.449 0.451 0.453 0.455 0.457 0.459 0.461 0.463 0.465 0.467 0.469 0.471 0.473 0.475 0.477 0.479 0.481 0.483 0.485 0.487 0.489 0.491 0.493 0.495 0.497
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.499 0.501 0.503 0.505 0.507 0.509 0.511 0.513 0.515 0.517 0.519 0.521 0.523 0.525 0.527 0.529 0.531 0.533 0.535 0.536 0.538 0.540 0.542 0.544 0.546
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
η
–3
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.055 0.060 0.065 0.070 0.075 0.080 0.085 0.090 0.095 0.100 0.105 0.110 0.115 0.120
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
0.125 0.130 0.135 0.140 0.145 0.150 0.155 0.160 0.165 0.170 0.175 0.180 0.185 0.190 0.195 0.200 0.205 0.210 0.215 0.220 0.225 0.230 0.235 0.240 0.245
0.548 0.550 0.552 0.554 0.556 0.558 0.560 0.562 0.564 0.566 0.568 0.570 0.572 0.574 0.576 0.578 0.580 0.582 0.584 0.586 0.588 0.590 0.592 0.593 0.595
19
20
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.597 0.599 0.601 0.603 0.605 0.607 0.609 0.611 0.613 0.615 0.617 0.618 0.620 0.622 0.624 0.626 0.628 0.630 0.632 0.634 0.635 0.637 0.639 0.641 0.643
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700
η
–3
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
0.250 0.255 0.260 0.265 0.270 0.275 0.280 0.285 0.290 0.295 0.300 0.305 0.310 0.315 0.320 0.325 0.330 0.335 0.340 0.345 0.350 0.355 0.360 0.365 0.370
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
0.375 0.380 0.385 0.390 0.395 0.400 0.405 0.410 0.415 0.420 0.425 0.430 0.435 0.440 0.445 0.450 0.455 0.460 0.465 0.470 0.475 0.480 0.485 0.490 0.495
0.645 0.647 0.649 0.650 0.652 0.654 0.656 0.658 0.660 0.661 0.663 0.665 0.667 0.669 0.670 0.672 0.674 0.676 0.678 0.679 0.681 0.683 0.685 0.687 0.688
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.690 0.692 0.694 0.695 0.697 0.699 0.701 0.702 0.704 0.706 0.707 0.709 0.711 0.713 0.714 0.716 0.718 0.719 0.721 0.723 0.724 0.726 0.728 0.729 0.731
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750
η
–3
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
0.500 0.505 0.510 0.515 0.520 0.525 0.530 0.535 0.540 0.545 0.550 0.555 0.560 0.565 0.570 0.575 0.580 0.585 0.590 0.595 0.600 0.605 0.610 0.615 0.620
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
0.625 0.630 0.635 0.640 0.645 0.650 0.655 0.660 0.665 0.670 0.675 0.680 0.685 0.690 0.695 0.700 0.705 0.710 0.715 0.720 0.725 0.730 0.735 0.740 0.745
0.733 0.734 0.736 0.738 0.739 0.741 0.742 0.744 0.746 0.747 0.749 0.750 0.752 0.754 0.755 0.757 0.758 0.760 0.761 0.763 0.764 0.766 0.767 0.769 0.771
21
22
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.772 0.774 0.775 0.777 0.778 0.779 0.781 0.782 0.784 0.785 0.787 0.788 0.790 0.791 0.793 0.794 0.795 0.797 0.798 0.800 0.801 0.802 0.804 0.805 0.806
776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
η
–3
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
0.750 0.755 0.760 0.765 0.770 0.775 0.780 0.785 0.790 0.795 0.800 0.805 0.810 0.815 0.820 0.825 0.830 0.835 0.840 0.845 0.850 0.855 0.860 0.865 0.870
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
0.875 0.880 0.885 0.890 0.895 0.900 0.905 0.910 0.915 0.920 0.925 0.930 0.935 0.940 0.945 0.950 0.955 0.960 0.965 0.970 0.975 0.980 0.985 0.990 0.995
0.808 0.809 0.811 0.812 0.813 0.815 0.816 0.817 0.819 0.820 0.821 0.822 0.824 0.825 0.826 0.828 0.829 0.830 0.831 0.833 0.834 0.835 0.836 0.838 0.839
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.840 0.841 0.842 0.844 0.845 0.846 0.847 0.848 0.849 0.851 0.852 0.853 0.854 0.855 0.856 0.857 0.859 0.860 0.861 0.862 0.863 0.864 0.865 0.866 0.867
826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850
η
–3
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
1.000 1.005 1.010 1.015 1.020 1.025 1.030 1.035 1.040 1.045 1.050 1.055 1.060 1.065 1.070 1.075 1.080 1.085 1.090 1.095 1.100 1.105 1.110 1.115 1.120
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
1.125 1.130 1.135 1.140 1.145 1.150 1.155 1.160 1.165 1.170 1.175 1.180 1.185 1.190 1.195 1.200 1.205 1.210 1.215 1.220 1.225 1.230 1.235 1.240 1.245
0.868 0.869 0.870 0.872 0.873 0.874 0.875 0.876 0.877 0.878 0.879 0.880 0.881 0.882 0.883 0.884 0.885 0.886 0.886 0.887 0.888 0.889 0.890 0.891 0.892
23
24
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.893 0.894 0.895 0.896 0.897 0.897 0.898 0.899 0.900 0.901 0.902 0.903 0.904 0.904 0.905 0.906 0.907 0.908 0.909 0.909 0.910 0.911 0.912 0.913 0.913
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
η
–3
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875
1.250 1.255 1.260 1.265 1.270 1.275 1.280 1.285 1.290 1.295 1.300 1.305 1.310 1.315 1.320 1.325 1.330 1.335 1.340 1.345 1.350 1.355 1.360 1.365 1.370
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
1.375 1.380 1.385 1.390 1.395 1.400 1.405 1.410 1.415 1.420 1.425 1.430 1.435 1.440 1.445 1.450 1.455 1.460 1.465 1.470 1.475 1.480 1.485 1.490 1.495
0.914 0.915 0.916 0.916 0.917 0.918 0.919 0.919 0.920 0.921 0.922 0.922 0.923 0.924 0.924 0.925 0.926 0.927 0.927 0.928 0.929 0.929 0.930 0.931 0.931
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.932 0.932 0.933 0.934 0.934 0.935 0.936 0.936 0.937 0.937 0.938 0.939 0.939 0.940 0.940 0.941 0.942 0.942 0.943 0.943 0.944 0.944 0.945 0.945 0.946
926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950
η
–3
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925
1.500 1.505 1.510 1.515 1.520 1.525 1.530 1.535 1.540 1.545 1.550 1.555 1.560 1.565 1.570 1.575 1.580 1.585 1.590 1.595 1.600 1.605 1.610 1.615 1.620
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
1.625 1.630 1.635 1.640 1.645 1.650 1.655 1.660 1.665 1.670 1.675 1.680 1.685 1.690 1.695 1.700 1.705 1.710 1.715 1.720 1.725 1.730 1.735 1.740 1.745
0.947 0.947 0.948 0.948 0.949 0.949 0.950 0.950 0.951 0.951 0.952 0.952 0.953 0.953 0.954 0.954 0.955 0.955 0.955 0.956 0.956 0.957 0.957 0.958 0.958
25
26
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.959 0.959 0.959 0.960 0.960 0.961 0.961 0.962 0.962 0.962 0.963 0.963 0.964 0.964 0.964 0.965 0.965 0.965 0.966 0.966 0.966 0.967 0.967 0.968 0.968
976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
η
–3
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975
1.750 1.755 1.760 1.765 1.770 1.775 1.780 1.785 1.790 1.795 1.800 1.805 1.810 1.815 1.820 1.825 1.830 1.835 1.840 1.845 1.850 1.855 1.860 1.865 1.870
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
1.875 1.880 1.885 1.890 1.895 1.900 1.905 1.910 1.915 1.920 1.925 1.930 1.935 1.940 1.945 1.950 1.955 1.960 1.965 1.970 1.975 1.980 1.985 1.990 1.995
0.968 0.969 0.969 0.969 0.970 0.970 0.970 0.971 0.971 0.971 0.972 0.972 0.972 0.972 0.973 0.973 0.973 0.974 0.974 0.974 0.975 0.975 0.975 0.975 0.976
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.976 0.976 0.976 0.977 0.977 0.977 0.977 0.978 0.978 0.978 0.978 0.979 0.979 0.979 0.979 0.980 0.980 0.980 0.980 0.981 0.981 0.981 0.981 0.981 0.982
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050
η
–3
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
2.000 2.005 2.010 2.015 2.020 2.025 2.030 2.035 2.040 2.045 2.050 2.055 2.060 2.065 2.070 2.075 2.080 2.085 2.090 2.095 2.100 2.105 2.110 2.115 2.120
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
2.125 2.130 2.135 2.140 2.145 2.150 2.155 2.160 2.165 2.170 2.175 2.180 2.185 2.190 2.195 2.200 2.205 2.210 2.215 2.220 2.225 2.230 2.235 2.240 2.245
0.982 0.982 0.982 0.982 0.983 0.983 0.983 0.983 0.983 0.984 0.984 0.984 0.984 0.984 0.985 0.985 0.985 0.985 0.985 0.985 0.986 0.986 0.986 0.986 0.986
27
28
1. INTRODUCTION
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.986 0.987 0.987 0.987 0.987 0.987 0.987 0.987 0.988 0.988 0.988 0.988 0.988 0.988 0.988 0.989 0.989 0.989 0.989 0.989 0.989 0.989 0.990 0.990 0.990
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100
η
–3
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075
2.250 2.255 2.260 2.265 2.270 2.275 2.280 2.285 2.290 2.295 2.300 2.305 2.310 2.315 2.320 2.325 2.330 2.335 2.340 2.345 2.350 2.355 2.360 2.365 2.370
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
2.375 2.380 2.385 2.390 2.395 2.400 2.405 2.410 2.415 2.420 2.425 2.430 2.435 2.440 2.445 2.450 2.455 2.460 2.465 2.470 2.475 2.480 2.485 2.490 2.495
0.990 0.990 0.990 0.990 0.990 0.990 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.991 0.992 0.992 0.992 0.992 0.992 0.992 0.992 0.992 0.992 0.992
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
η
i
η
1
η
1 – exp3– – x24dx ∫ Ï· 2 2π
i
0.992 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.993 0.994 0.994 0.994 0.994 0.994 0.994 0.994 0.994 0.994 0.994 0.994
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
η
–3
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
2.500 2.505 2.510 2.515 2.520 2.525 2.530 2.535 2.540 2.545 2.550 2.555 2.560 2.565 2.570 2.575 2.580 2.585 2.590 2.595 2.600 2.605 2.610 2.615 2.620
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
2.625 2.630 2.635 2.640 2.645 2.650 2.655 2.660 2.665 2.670 2.675 2.680 2.685 2.690 2.695 2.700 2.705 2.710 2.715 2.720 2.725 2.730 2.735 2.740 2.745
0.994 0.994 0.994 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.995 0.996 0.996 0.996
29
30
1. INTRODUCTION
η
i
η
1
1 – exp3– – x24dx ∫ Ï· 2 2π
η
i
η
–3
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175
2.750 2.755 2.760 2.765 2.770 2.775 2.780 2.785 2.790 2.795 2.800 2.805 2.810 2.815 2.820 2.825 2.830 2.835 2.840 2.845 2.850 2.855 2.860 2.865 2.870
0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.996 0.997 0.997 0.997
1
1 – exp3– – x24dx ∫ Ï· 2 2π
–3
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201
2.875 2.880 2.885 2.890 2.895 2.900 2.905 2.910 2.915 2.920 2.925 2.930 2.935 2.940 2.945 2.950 2.955 2.960 2.965 2.970 2.975 2.980 2.985 2.990 2.995 3.000
0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997 0.997
1.6. EXAMPLES OF TRANSFORMATION OR MODELING OF RANDOM VARIABLE
31
Table 1.4: Showing 100 random numbers g obeying Gaussian or Normal probability density h 2 i 1 x a 1 function pg .x/ D p2 Exp 2 with a D 0 and D 1. ui ’s are corresponding values of uniform random numbers in the interval 0 to 1 (of Table 1.1). i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui 0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
gi –0.955 –1.635 1.015 –0.905 0.255 2.195 0.605 –1.040 0.805 0.520 –2.295 –0.255 1.050 0.715 –0.495 –1.205 –0.795 0.880 –1.370 –0.590 –0.695 2.325 0.020 0.910 –0.935
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui 0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
gi –0.750 0.490 –1.540 –1.465 0.980 –0.085 –0.605 0.895 –0.315 2.145 –0.905 0.210 0.285 –0.080 0.290 0.735 0.885 –0.095 2.195 0.630 0.150 1.200 –0.740 1.415 0.060
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui 0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
gi i –0.270 76 –0.505 77 0.915 78 0.310 79 1.155 80 0.750 81 –0.020 82 –0.430 83 –0.890 84 0.165 85 –0.165 86 0.430 87 0.040 88 0.410 89 0.555 90 0.040 91 0.480 92 –1.320 93 –0.205 94 0.250 95 0.475 96 1.635 97 –1.145 98 –1.035 99 –0.685 100
ui 0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
gi –0.730 0.985 –0.960 0.115 0.670 –0.150 0.455 –0.560 –1.615 1.565 0.470 1.350 –0.660 –0.715 1.060 1.165 –0.040 –1.185 1.030 –0.835 –0.540 –1.460 –1.505 0.645 1.695
32
1. INTRODUCTION
Program 1.3
h=0.005; eta=-3.005; i=0; Table[{i=i+1,eta=eta+h,int=(1/Sqrt[2*3.1416])*Integrate [Exp[-0.5*x^2], {x,-3,eta}]},{eta,-3.005,2.995,h}]; TableForm[%,TableSpacing->{2,2}, TableHeadings->{None,{"i","eta","integral"}}]
We now discuss modeling of random variable G obeying Gaussian or Normal probability density function given by 1 x a 2 1 PG .x/ D p Exp (1.7) 2 2
Example 1.4
with non-zero value of a and ¤ 1. It is well known that values of G are related to those of g via G D a C g; (1.8) where values of g are random numbers obeying Equation (1.7) with a D 0 and D 1.
1.7
VARIANCE REDUCTION AND IMPORTANCE SAMPLING
Let us consider a definite integral I D
Z
b
F .x/dx:
(1.9)
Z
(1.10)
a
Let us re-write Equation (1.9) as I D
Z a
b
F .x/ p.x/dx D p.x/
b
f .x/p.x/dx
a
where f .x/ D F .x/=p.x/. As discussed in Section 1.2, average value of any function of x , say f .x/, is given by Rb Af D a f .x/p.x/dx where p.x/ is a normalized probability density function. Thus, according to Equation (1.10), value I of the integral is average value of F=p .
1.7. VARIANCE REDUCTION AND IMPORTANCE SAMPLING
33
Table 1.5: Showing 100 random G obeying Gaussian or Normal probability density h numbers 2 i x a 1 1 function PG .x/ D p2 Exp 2 with a D =2 and D 0:5. ui ’s are corresponding values of uniform random numbers in the interval 0 to 1i and g ’s are corresponding values of h 2 1 1 x random numbers obeying pg .x/ D p2 Exp 2 a with a D 0 and D 1. Values of G have been obtained using G D a C g D =2 C 0:5g . i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui gi 0.169 –0.955 0.050 –1.635 0.844 1.015 0.182 –0.905 0.599 0.255 0.985 2.195 0.726 0.605 0.148 –1.040 0.788 0.805 0.698 0.520 0.010 –2.295 0.397 –0.255 0.852 1.050 0.761 0.715 0.309 –0.495 0.113 –1.205 0.212 –0.795 0.809 0.880 0.084 –1.370 0.276 –0.590 0.243 –0.695 0.989 2.325 0.508 0.020 0.817 0.910 0.174 –0.935
Gi 1.093 0.753 2.078 1.118 1.698 2.668 1.873 1.051 1.973 1.831 0.423 1.443 2.096 1.928 1.323 0.968 1.173 2.011 0.886 1.276 1.223 2.733 1.581 2.026 1.103
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui gi Gi 0.225 –0.750 1.196 0.687 0.490 1.816 0.060 –1.540 0.801 0.070 –1.465 0.838 0.835 0.980 2.061 0.466 –0.085 1.528 0.271 –0.605 1.268 0.813 0.895 2.018 0.376 –0.315 1.413 0.983 2.145 2.643 0.181 –0.905 1.118 0.583 0.210 1.676 0.612 0.285 1.713 0.468 –0.080 1.531 0.614 0.290 1.716 0.768 0.735 1.938 0.811 0.885 2.013 0.461 –0.095 1.523 0.985 2.195 2.668 0.735 0.630 1.886 0.559 0.150 1.646 0.884 1.200 2.171 0.229 –0.740 1.201 0.920 1.415 2.278 0.524 0.060 1.601
34
1. INTRODUCTION
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui gi 0.393 –0.270 0.306 –0.505 0.819 0.915 0.620 0.310 0.875 1.155 0.773 0.750 0.492 –0.020 0.332 –0.430 0.185 –0.890 0.565 0.165 0.434 –0.165 0.665 0.430 0.516 0.040 0.659 0.410 0.709 0.555 0.515 0.040 0.683 0.480 0.092 –1.320 0.417 –0.205 0.598 0.250 0.682 0.475 0.948 1.635 0.125 –1.145 0.149 –1.035 0.246 –0.685
Gi 1.436 1.318 2.028 1.726 2.148 1.946 1.561 1.356 1.126 1.653 1.488 1.786 1.591 1.776 1.848 1.591 1.811 0.911 1.468 1.696 1.808 2.388 0.998 1.053 1.228
i 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
ui gi Gi 0.231 –0.730 1.206 0.836 0.985 2.063 0.167 –0.960 1.091 0.545 0.115 1.628 0.748 0.670 1.906 0.440 –0.150 1.496 0.674 0.455 1.798 0.287 –0.560 1.291 0.052 –1.615 0.763 0.940 1.565 2.353 0.679 0.470 1.806 0.910 1.350 2.246 0.254 –0.660 1.241 0.236 –0.715 1.213 0.854 1.060 2.101 0.877 1.165 2.153 0.483 –0.040 1.551 0.117 –1.185 0.978 0.847 1.030 2.086 0.201 –0.835 1.153 0.294 –0.540 1.301 0.071 –1.460 0.841 0.065 –1.505 0.818 0.740 0.645 1.893 0.954 1.695 2.418
1.7. VARIANCE REDUCTION AND IMPORTANCE SAMPLING
35
We can choose any functional form for p.x/, but as proved below, choosing p.x/ as proportional to F .x/ ensures that the variance of f .x/ D F=p is small. This will ensure a better Rb value of the average and hence a better value of the integral I D a F .x/dx . Variance of f .x/ is square of standard deviation. Variance of f .x/ is given by h 2 i V Œf .x/ D A f Af ; (1.11) where A stands for average value. Thus, h i Vf .x/ D A f 2 2fAf C Af2 D A f 2 D A.f 2 /
2Af Af C Af2
Af2
or, Vf .x/ D D
Z
Z
b 2
f .x/p.x/dx
a
Z a
b
f .x/p.x/dx
!2
a b
Z
F2 pdx p2
b
F p.x/dx p
a
Thus, the variance is Vf .x/ D
Z
b
a
!2
D
F2 dx p
Z
b
F2 dx p
a
Z
b
F dx
!2
:
a
I 2:
(1.12)
If p.x/ is taken as p.x/ D R b a
jF .x/j
(1.13)
jF .x/j dx
the variance given by Equation (1.12) becomes Vf .x/ D
Z a
b
Rb a
F2 jF .x/j
I2
dx
jF .x/j dx
or, Vf .x/ D
Z
b a
jF .x/j dx
! Z a
b
jF .x/j dx
!
I2 D
Z
b a
jF .x/j dx
!2
I 2:
(1.14)
Rb Equation (1.14) in conjunction with Equation (1.9): I D a F .x/dx reveals that the variance vanishes if the integrand F .x/ does not change sign. If it does, the variance will be small if
36
1. INTRODUCTION
condition laid by Equation (1.13) is met. Thus, the probability density function p.x/ should be proportional to the integrand jF .x/j. This is the so-called importance sampling. Looking back at Equation (1.10), we find that value of the integral is approximately determined by the value of the average N 1 X F .xi / I D : N p.xi / i D1
As recommended by importance sampling, we need to take p.x/ D C F .x/ where C is a conRb Rb stant; we need to normalize p.x/ first; a p.x/dx D 1 gives a C F .x/dx D 1 or, C D Rb a
1
:
F .x/dx
Thus, p.x/ D R b a
The sum
F .x/
:
F .x/dx
N 1 X F .xi / N p.xi / i D1
becomes
N 1 X N i D1
Rb a
F .xi / F .xi /
D
Z
b
F .x/dx:
a
F .x/dx
Thus, the sum N 1 X F .xi / N p.xi / i D1
equals the integral if probability density function p.x/ is taken proportional to the integrand jF .x/j. Slight variation of p.x/ from proportionality with jF .x/j will result in slight difference of N 1 X F .xi / N p.xi / i D1 Rb from the actual value of the integral I D a F .x/dx .
37
CHAPTER
2
Evaluation of Definite Integrals Using the Monte Carlo Method 2.1
EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD: EXAMPLE I
As Example I, we now take up the integral Z b Z I D F .x/dx D a
Sin.x/dx;
(2.1)
0
where F .x/ D Sin.x/. We re-write Equation (2.1) as Z b F .x/ I D p.x/dx a p.x/
(2.2)
which, as discussed in Section 1.7, implies that average value of F=p is the value of the integral, i.e., N 1 X F .xi / I D ; (2.3) N p.xi / iD1 where xi ’s are random values of x in the interval a < x < b obeying probability density function p.x/. Here p.x/ is a suitable probability density function which, as demonstrated in Section 1.7, at least should follow F .x/, if not be proportional to F .x/. See Figure 2.1 in which we have plotted F .x/ D Sin.x/ along with normalized probability density function of a uniform random variable in the R interval 0 to given by p.x/ D 1= . Let p.x/ D C , a constant. Normalization requires that 0 Cdx D 1 which gives C D 1= . Uniform p.x/ D 1= is not too different from a slowly varying function of x like Sin.x/. Hence, p.x/ D 1= is a good choice. We now generate random variable obeying p.x/ D 1= in the interval 0 < x < using Equation (1.4): D a C .b a/u where u is random variable (of Table 1.1) of uniform probability density function in the interval 0 < x R< 1. Thus, we have D u. That D u can be R calculated using a p.x/dx D u which gives 0 .1=/dx D u or, D u.
38
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
F(x) = Sin(x) or p(x) = 1/π
1.0 0.8 0.6 0.4 0.2 0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
x
Figure 2.1: Showing F .x/ D Sin.x/ as undashed curve and p.x/ D 1= as dashed curve obtained using the command Plot[{Sin[x],1/Pi},{x,0,Pi},Frame->True,FrameLabel-> {"x","F(x) = Sin(x) or p(x) = 1/\[Pi]"},PlotStyle-> {{Black},{Dashed,Black}}] in Mathematica 6.0.
Using Table 2.1 in Microsoft Excel, we have evaluated the integral with the result 1.973 rather than 2. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other. We now take up a linear variation for p.x/ given by p.x/ D C x where C is a conR stant. Normalization requires that 0 C xdx D 1 which gives C D 2= 2 . Thus, normalized p.x/ D 2x= 2 . See Figure 2.2 in which we have plotted F .x/ D Sin.x/ along with the normalized linear probability density function p.x/ D 2x= 2 . The linear probability density function p.x/ D 2x= 2 is not too different from a slowly varying function of x like Sin.x/. Hence, it is a good choice. 2 We now generate R random variable R obeying p.x/ D 2x= in the interval 0 < x < using Equation (1.2): a p.x/dx D u or, 0 p.x/dx D u where u is random variable (of Table 1.1) of uniform probability density function in the interval 0 < x < 1. Thus, we have D u1=2 . Using Table 2.2 in Microsoft Excel, we have evaluated the integral with the result 1.947 rather than 2. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other. We h now take i up a normalized Gaussian variation for p.x/ given by p.x/ D 2 1 p Exp 21 x a where a is average and is variance of x . See Figure 2.3 in which we 2 have plotted F .x/ D Sin.x/ along with the normalized Gaussian probability density function
2.1. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE I
39
Table 2.1: Showing tabulated values of ui , i D ui , Sin.i / from which we get I D F .xi / F .i / 1 PN 1 PN PN i D1 p.xi / D N i D1 1= D N i D1 Sin.i / as an approximate value of the integral N Rb R I D a F .x/dx D 0 Sin.x/dx D 1:973 whereas the exact value is 2. Using p.x/ D 1= . i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui ηi = π ui Sin(ηi) 0.169 0.531 0.506 0.050 0.157 0.156 0.844 2.652 0.471 0.182 0.572 0.541 0.599 1.882 0.952 0.985 3.094 0.047 0.726 2.281 0.758 0.148 0.465 0.448 0.788 2.476 0.618 0.698 2.193 0.813 0.010 0.031 0.031 0.397 1.247 0.948 0.852 2.677 0.448 0.761 2.391 0.682 0.309 0.971 0.825 0.113 0.355 0.348 0.212 0.666 0.618 0.809 2.542 0.565 0.084 0.264 0.261 0.276 0.867 0.762 0.243 0.763 0.691 0.989 3.107 0.035 0.508 1.596 1.000 0.817 2.567 0.544 0.174 0.547 0.520
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui ηi = π ui Sin(ηi) 0.225 0.707 0.649 0.687 2.158 0.832 0.060 0.188 0.187 0.070 0.220 0.218 0.835 2.623 0.495 0.466 1.464 0.994 0.271 0.851 0.752 0.813 2.554 0.554 0.376 1.181 0.925 0.983 3.088 0.053 0.181 0.569 0.538 0.583 1.832 0.966 0.612 1.923 0.939 0.468 1.470 0.995 0.614 1.929 0.937 0.768 2.413 0.666 0.811 2.548 0.559 0.461 1.448 0.993 0.985 3.094 0.047 0.735 2.309 0.740 0.559 1.756 0.983 0.884 2.777 0.356 0.229 0.719 0.659 0.920 2.890 0.249 0.524 1.646 0.997
40
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui ηi = π ui Sin(ηi) i 0.393 1.235 0.944 76 0.306 0.961 0.820 77 0.819 2.573 0.538 78 0.620 1.948 0.930 79 0.875 2.749 0.383 80 0.773 2.428 0.654 81 0.492 1.546 1.000 82 0.332 1.043 0.864 83 0.185 0.581 0.549 84 0.565 1.775 0.979 85 0.434 1.363 0.979 86 0.665 2.089 0.869 87 0.516 1.621 0.999 88 0.659 2.070 0.878 89 0.709 2.227 0.792 90 0.515 1.618 0.999 91 0.683 2.146 0.839 92 0.092 0.289 0.285 93 0.417 1.310 0.966 94 0.598 1.879 0.953 95 0.682 2.143 0.841 96 0.948 2.978 0.163 97 0.125 0.393 0.383 98 0.149 0.468 0.451 99 0.246 0.773 0.698 100
ui ηi = π ui Sin(ηi) 0.231 0.726 0.664 0.836 2.626 0.493 0.167 0.525 0.501 0.545 1.712 0.990 0.748 2.350 0.712 0.440 1.382 0.982 0.674 2.117 0.854 0.287 0.902 0.784 0.052 0.163 0.163 0.940 2.953 0.187 0.679 2.133 0.846 0.910 2.859 0.279 0.254 0.798 0.716 0.236 0.741 0.675 0.854 2.683 0.443 0.877 2.755 0.377 0.483 1.517 0.999 0.117 0.368 0.359 0.847 2.661 0.462 0.201 0.631 0.590 0.294 0.924 0.798 0.071 0.223 0.221 0.065 0.204 0.203 0.740 2.325 0.729 0.954 2.997 0.144 Sum = 62.800 I = 1.973
2.1. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE I
41
F(x) = S in(x) or p(x)
1.0 0.8 0.6 0.4 0.2 0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
x
Figure 2.2: Showing F .x/ D Sin.x/ as undashed curve and p.x/ D 2x= 2 as dashed curve obtained using the command Plot[{Sin[x],(2*x)/(Pi^2)},{x,0,Pi},Frame->True,FrameLabel-> {"x","F(x) = Sin(x) or p(x)"},PlotStyle-> {{Black},{Dashed,Black}}] in Mathematica 6.0. F(x) = Sin(x) or Gaussian(x)
1.0 0.8 0.6 0.4 0.2 0.0 0.0
0.5
1.0
1.5
2.0
2.5
3.0
x
Figure 2.3: Showing F .x/ D Sin.x/ as undashed curve and Gaussian p.x/ D h 2 i Exp 21 x a as dashed curve obtained using the command sig=0.5;a=Pi/2; p1=Plot[Sin[x],{x,0,Pi},PlotStyle->{Black},Frame->True, FrameLabel->{"x","F(x) = Sin(x) or Gaussian (x)"}]; p2=Plot[(1/(sig*Sqrt[2*Pi]))*Exp[-0.5*((x-a)/sig)^2],{x,0,Pi}, PlotStyle->{Dashed,Black}];Show[p1,p2] in Mathematica 6.0.
p1 2
42
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
Table 2.2: Showing tabulated values of ui , i D u1=2 i , Sin.i /=i from which we get I D F .xi / Sin.i / Sin.i / 1 PN 1 PN 2 PN as an approximate value of the integral i D1 p.xi / D N i D1 2i = 2 D 2N i D1 N i Rb R I D a F .x/dx D 0 Sin.x/dx D 1:947 whereas the exact value is 2. Using p.x/ D 2x= 2 . i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui ηi = π ui1/2 Sin(ηi)/ηi 0.169 1.291 0.744 0.050 0.702 0.920 0.844 2.886 0.088 0.182 1.340 0.726 0.599 2.431 0.268 0.985 3.118 0.008 0.726 2.677 0.167 0.148 1.209 0.774 0.788 2.789 0.124 0.698 2.625 0.188 0.010 0.314 0.984 0.397 1.979 0.464 0.852 2.900 0.083 0.761 2.741 0.142 0.309 1.746 0.564 0.113 1.056 0.824 0.212 1.447 0.686 0.809 2.826 0.110 0.084 0.911 0.867 0.276 1.650 0.604 0.243 1.549 0.646 0.989 3.124 0.006 0.508 2.239 0.351 0.817 2.840 0.105 0.174 1.310 0.737
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui ηi = π ui1/2 Sin(ηi)/ηi 0.225 1.490 0.669 0.687 2.604 0.197 0.060 0.770 0.904 0.070 0.831 0.889 0.835 2.871 0.093 0.466 2.145 0.392 0.271 1.635 0.610 0.813 2.833 0.107 0.376 1.926 0.487 0.983 3.115 0.009 0.181 1.337 0.728 0.583 2.399 0.282 0.612 2.458 0.257 0.468 2.149 0.390 0.614 2.462 0.255 0.768 2.753 0.138 0.811 2.829 0.109 0.461 2.133 0.397 0.985 3.118 0.008 0.735 2.693 0.161 0.559 2.349 0.303 0.884 2.954 0.063 0.229 1.503 0.664 0.920 3.013 0.042 0.524 2.274 0.335
2.1. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE I
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui ηi = π ui1/2 Sin(ηi)/ηi i 0.393 1.969 0.468 76 0.306 1.738 0.567 77 0.819 2.843 0.103 78 0.620 2.474 0.250 79 0.875 2.939 0.069 80 0.773 2.762 0.134 81 0.492 2.204 0.366 82 0.332 1.810 0.537 83 0.185 1.351 0.722 84 0.565 2.361 0.298 85 0.434 2.070 0.424 86 0.665 2.562 0.214 87 0.516 2.257 0.343 88 0.659 2.550 0.219 89 0.709 2.645 0.180 90 0.515 2.255 0.344 91 0.683 2.596 0.200 92 0.092 0.953 0.855 93 0.417 2.029 0.442 94 0.598 2.429 0.269 95 0.682 2.594 0.201 96 0.948 3.059 0.027 97 0.125 1.111 0.807 98 0.149 1.213 0.772 99 0.246 1.558 0.642 100
ui ηi = π ui1/2 Sin(ηi)/ηi 0.231 1.510 0.661 0.836 2.872 0.093 0.167 1.284 0.747 0.545 2.319 0.316 0.748 2.717 0.152 0.440 2.084 0.418 0.674 2.579 0.207 0.287 1.683 0.590 0.052 0.716 0.917 0.940 3.046 0.031 0.679 2.589 0.203 0.910 2.997 0.048 0.254 1.583 0.632 0.236 1.526 0.655 0.854 2.903 0.081 0.877 2.942 0.067 0.483 2.183 0.375 0.117 1.075 0.818 0.847 2.891 0.086 0.201 1.408 0.701 0.294 1.703 0.582 0.071 0.837 0.887 0.065 0.801 0.896 0.740 2.703 0.157 0.954 3.068 0.024 Sum = 39.461 I = 1.947
43
44
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
p.x/. As Figure 2.3 shows, the Gaussian probability density function p.x/ with a D =2 and D 0:5 is not too different from the function Sin.x/. Hence, it is ideal for use as p.x/. We now generate random variable G obeying " # 1 1 G a 2 p.G/ D p Exp 2 2
with a D =2 and D 0:5 using the tabulated values of random variable g of Table 1.4 obeying 1 g a 2 1 p.g/ D p Exp 2 2 for a D 0 and D 1. The connection is G D a C g D =2 C 0:5g . Using Table 2.3 in Microsoft Excel, we have evaluated the integral with the result 1.950 rather than 2. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other.
2.2
EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD: EXAMPLE II
As Example II, we now take up the integral Z b Z I D F .x/dx D a
C=2
Cos.x/dx;
(2.4)
=2
where F .x/ D Cos.x/. We re-write Equation (2.4) as Z b F .x/ I D p.x/dx a p.x/
(2.5)
which, as discussed in Section 1.7, implies that average value of F=p is the value of the integral, i.e., N 1 X F .xi / ; (2.6) I D N p.xi / i D1
where xi ’s are random values of x in the interval a < x < b obeying probability density function p.x/. Here, p.x/ is a suitable probability density function which, as demonstrated in Section 1.7, at least should follow F .x/, if not be proportional to F .x/. See Figure 2.4 in which we have plotted F .x/ D Cos.x/ along with normalized probability density function of a uniform random variable in the interval =2 to C=2 given by p.x/ D 1= . Let p.x/ D C , a constant. NorR C=2 malization requires that =2 Cdx D 1 which gives C D 1= . Uniform p.x/ D 1= is not too different from a slowly varying function of x like Cos.x/. Hence, p.x/ D 1= is a good choice.
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
45
Table 2.3: Showing tabulated values of ui , gi , Gi , Sin.Gi /=pi from which we get I D P F .xi / Sin.Gi / Sin 1 PN 1 PN .Gi/ D N1 N as an approximate value of i D1 p.xi / D N i D1 i D1 N pi G a 2 the integralhI D p1 2
Exp
1 2
Rb
a F .x/dx i x a 2 .
i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
D
R 0
1 p Exp 2
1 2
i
Sin.x/dx D 1:950 whereas the exact value is 2. Using p.x/ D
ui gi 0.169 –0.955 0.050 –1.635 0.844 1.015 0.182 –0.905 0.599 0.255 0.985 2.195 0.726 0.605 0.148 –1.040 0.788 0.805 0.698 0.520 0.010 –2.295 0.397 –0.255 0.852 1.050 0.761 0.715 0.309 –0.495 0.113 –1.205 0.212 –0.795 0.809 0.880 0.084 –1.370 0.276 –0.590 0.243 –0.695 0.989 2.325 0.508 0.020 0.817 0.910 0.174 –0.935
Gi 1.093 0.753 2.078 1.118 1.698 2.668 1.873 1.051 1.973 1.831 0.423 1.443 2.096 1.928 1.323 0.968 1.173 2.011 0.886 1.276 1.223 2.733 1.581 2.026 1.103
SinGi 0.888 0.684 0.874 0.899 0.992 0.456 0.955 0.868 0.920 0.966 0.411 0.992 0.865 0.937 0.970 0.824 0.922 0.905 0.774 0.957 0.940 0.397 1.000 0.898 0.893
pi (SinGi)/pi 0.506 1.756 0.210 3.263 0.477 1.833 0.530 1.698 0.772 1.284 0.072 6.354 0.664 1.437 0.465 1.868 0.577 1.594 0.697 1.387 0.057 7.168 0.772 1.284 0.460 1.882 0.618 1.516 0.706 1.373 0.386 2.134 0.582 1.585 0.542 1.670 0.312 2.481 0.670 1.427 0.627 1.500 0.053 7.425 0.798 1.254 0.527 1.703 0.515 1.732
46
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui gi 0.225 –0.750 0.687 0.490 0.060 –1.540 0.070 –1.465 0.835 0.980 0.466 –0.085 0.271 –0.605 0.813 0.895 0.376 –0.315 0.983 2.145 0.181 –0.905 0.583 0.210 0.612 0.285 0.468 –0.080 0.614 0.290 0.768 0.735 0.811 0.885 0.461 –0.095 0.985 2.195 0.735 0.630 0.559 0.150 0.884 1.200 0.229 –0.740 0.920 1.415 0.524 0.060
Gi 1.196 1.816 0.801 0.838 2.061 1.528 1.268 2.018 1.413 2.643 1.118 1.676 1.713 1.531 1.716 1.938 2.013 1.523 2.668 1.886 1.646 2.171 1.201 2.278 1.601
SinGi 0.931 0.970 0.718 0.744 0.882 0.999 0.955 0.902 0.988 0.478 0.899 0.994 0.990 0.999 0.990 0.933 0.904 0.999 0.456 0.951 0.997 0.825 0.932 0.760 1.000
pi (SinGi)/pi 0.602 1.545 0.708 1.371 0.244 2.945 0.273 2.725 0.494 1.787 0.795 1.257 0.664 1.437 0.535 1.686 0.759 1.301 0.080 5.978 0.530 1.698 0.780 1.274 0.766 1.292 0.795 1.256 0.765 1.293 0.609 1.532 0.539 1.676 0.794 1.258 0.072 6.354 0.654 1.453 0.789 1.264 0.388 2.125 0.607 1.537 0.293 2.592 0.796 1.255
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui gi 0.393 –0.270 0.306 –0.505 0.819 0.915 0.620 0.310 0.875 1.155 0.773 0.750 0.492 –0.020 0.332 –0.430 0.185 –0.890 0.565 0.165 0.434 –0.165 0.665 0.430 0.516 0.040 0.659 0.410 0.709 0.555 0.515 0.040 0.683 0.480 0.092 –1.320 0.417 –0.205 0.598 0.250 0.682 0.475 0.948 1.635 0.125 –1.145 0.149 –1.035 0.246 –0.685
Gi 1.436 1.318 2.028 1.726 2.148 1.946 1.561 1.356 1.126 1.653 1.488 1.786 1.591 1.776 1.848 1.591 1.811 0.911 1.468 1.696 1.808 2.388 0.998 1.053 1.228
SinGi 0.991 0.968 0.897 0.988 0.838 0.931 1.000 0.977 0.903 0.997 0.997 0.977 1.000 0.979 0.962 1.000 0.971 0.790 0.995 0.992 0.972 0.684 0.841 0.869 0.942
pi (SinGi)/pi 0.769 1.288 0.702 1.379 0.525 1.709 0.760 1.299 0.410 2.046 0.602 1.545 0.798 1.254 0.727 1.343 0.537 1.681 0.787 1.266 0.787 1.266 0.727 1.343 0.797 1.254 0.734 1.335 0.684 1.406 0.797 1.254 0.711 1.366 0.334 2.366 0.781 1.273 0.773 1.283 0.713 1.364 0.210 3.263 0.414 2.029 0.467 1.861 0.631 1.493
47
48
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
ui gi 0.231 –0.730 0.836 0.985 0.167 –0.960 0.545 0.115 0.748 0.670 0.440 –0.150 0.674 0.455 0.287 –0.560 0.052 –1.615 0.940 1.565 0.679 0.470 0.910 1.350 0.254 –0.660 0.236 –0.715 0.854 1.060 0.877 1.165 0.483 –0.040 0.117 –1.185 0.847 1.030 0.201 –0.835 0.294 –0.540 0.071 –1.460 0.065 –1.505 0.740 0.645 0.954 1.695
Gi 1.206 2.063 1.091 1.628 1.906 1.496 1.798 1.291 0.763 2.353 1.806 2.246 1.241 1.213 2.101 2.153 1.551 0.978 2.086 1.153 1.301 0.841 0.818 1.893 2.418
SinGi 0.934 0.881 0.887 0.998 0.944 0.997 0.974 0.961 0.691 0.709 0.973 0.781 0.946 0.937 0.863 0.835 1.000 0.830 0.870 0.914 0.964 0.745 0.730 0.948 0.662
pi (SinGi)/pi 0.611 1.528 0.491 1.794 0.503 1.762 0.793 1.260 0.637 1.481 0.789 1.264 0.719 1.354 0.682 1.409 0.217 3.192 0.234 3.024 0.714 1.361 0.321 2.434 0.642 1.474 0.618 1.516 0.455 1.897 0.405 2.063 0.797 1.254 0.395 2.098 0.469 1.854 0.563 1.624 0.690 1.398 0.275 2.711 0.257 2.839 0.648 1.464 0.190 3.489 Sum = 195.012 I = 1.950
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
49
F(x) = Cos(x) or p(x)
1.0 0.8 0.6 0.4 0.2 0.0 –1.5
–1.0
–0.5
0.0
0.5
1.0
1.5
x
Figure 2.4: Showing F .x/ D Cos.x/ as undashed curve and p.x/ D 1= as dashed curve obtained using the command Plot[{Cos[x],1/Pi},{x,-Pi/2,Pi/2}, Frame->True,FrameLabel->{"x","F(x) = Cos(x) or p(x)"}, PlotStyle->{{Black},{Dashed,Black}}] in Mathematica 6.0.
We now generate random variable obeying p.x/ D 1= in the interval =2 < x < C=2 using Equation (1.4): D a C .b a/u where u is random variable (of Table 1.1) of uniform probability density function in the Rinterval 0 < x < 1. Thus, we have D u =2. That D u =2 can be calculated using a p.x/dx D u which gives Z
=2
.1=/dx D u
or, D u
=2:
Using Table 2.4 in Microsoft Excel, we have evaluated the integral with the result 1.973 rather than 2. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other. We now take up a linear variation for p.x/ given by p.x/ D C x C d where C and d are parameters such that slope C D intercept d on y axis =.=2/; hence, d D C =2. As such, R C=2 p.x/ D C.x C =2/. Normalization of p.x/ requires =2 p.x/dx D 1 or C D 2= 2 . As such, normalized probability density function is p.x/ D 2x= 2 C 1= . See Figure 2.5 in which we have plotted F .x/ D Cos.x/ along with the normalized linear probability density function p.x/ D 2x= 2 C 1= . The linear probability density function p.x/ D 2x= 2 C 1= is not too different from a slowly varying function of x like Cos.x/. Hence, it is a good choice.
50
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
Table 2.4: Showing tabulated values of ui , i D ui =2, Cos.i / from which we get I D F .xi / F .i / 1 PN PN 1 PN i D1 p.xi / D N i D1 1= D N i D1 Cos.i / as an approximate value of the integral N Rb R C=2 I D a F .x/dx D =2 Cos.x/dx D 1:973 whereas the exact value is 2. Using p.x/ D 1= . i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui ηi = π ui –π/2 Cos(ηi) 0.169 –1.040 0.506 0.050 –1.414 0.156 0.844 1.081 0.471 0.182 –0.999 0.541 0.599 0.311 0.952 0.985 1.524 0.047 0.726 0.710 0.758 0.148 –1.106 0.448 0.788 0.905 0.618 0.698 0.622 0.813 0.010 –1.539 0.031 0.397 –0.324 0.948 0.852 1.106 0.448 0.761 0.820 0.682 0.309 –0.600 0.825 0.113 –1.216 0.348 0.212 –0.905 0.618 0.809 0.971 0.565 0.084 –1.307 0.261 0.276 –0.704 0.762 0.243 –0.807 0.691 0.989 1.536 0.035 0.508 0.025 1.000 0.817 0.996 0.544 0.174 –1.024 0.520
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui ηi = π ui –π/2 Cos(ηi) 0.225 –0.864 0.649 0.687 0.587 0.832 0.060 –1.382 0.187 0.070 –1.351 0.218 0.835 1.052 0.495 0.466 –0.107 0.994 0.271 –0.719 0.752 0.813 0.983 0.554 0.376 –0.390 0.925 0.983 1.517 0.053 0.181 –1.002 0.538 0.583 0.261 0.966 0.612 0.352 0.939 0.468 –0.101 0.995 0.614 0.358 0.937 0.768 0.842 0.666 0.811 0.977 0.559 0.461 –0.123 0.993 0.985 1.524 0.047 0.735 0.738 0.740 0.559 0.185 0.983 0.884 1.206 0.356 0.229 –0.851 0.659 0.920 1.319 0.249 0.524 0.075 0.997
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui ηi = π ui –π/2 Cos(ηi) i 0.393 –0.336 0.944 76 0.306 –0.609 0.820 77 0.819 1.002 0.538 78 0.620 0.377 0.930 79 0.875 1.178 0.383 80 0.773 0.858 0.654 81 0.492 –0.025 1.000 82 0.332 –0.528 0.864 83 0.185 –0.990 0.549 84 0.565 0.204 0.979 85 0.434 –0.207 0.979 86 0.665 0.518 0.869 87 0.516 0.050 0.999 88 0.659 0.500 0.878 89 0.709 0.657 0.792 90 0.515 0.047 0.999 91 0.683 0.575 0.839 92 0.092 –1.282 0.285 93 0.417 –0.261 0.966 94 0.598 0.308 0.953 95 0.682 0.572 0.841 96 0.948 1.407 0.163 97 0.125 –1.178 0.383 98 0.149 –1.103 0.451 99 0.246 –0.798 0.698 100
ui ηi = π ui –π/2 Cos(ηi) 0.231 –0.845 0.664 0.836 1.056 0.493 0.167 –1.046 0.501 0.545 0.141 0.990 0.748 0.779 0.712 0.440 –0.188 0.982 0.674 0.547 0.854 0.287 –0.669 0.784 0.052 –1.407 0.163 0.940 1.382 0.187 0.679 0.562 0.846 0.910 1.288 0.279 0.254 –0.773 0.716 0.236 –0.829 0.675 0.854 1.112 0.443 0.877 1.184 0.377 0.483 –0.053 0.999 0.117 –1.203 0.359 0.847 1.090 0.462 0.201 –0.939 0.590 0.294 –0.647 0.798 0.071 –1.348 0.221 0.065 –1.367 0.203 0.740 0.754 0.729 0.954 1.426 0.144 Sum = 62.800 I = 1.973
51
52
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
F(x) = Cos(x) or p(x)
1.0 0.8 0.6 0.4 0.2 0.0 –1.5
–1.0
–0.5
0.0
0.5
1.0
1.5
x
Figure 2.5: Showing F .x/ D Cos.x/ as undashed curve and p.x/ D 2x= 2 C 1= as dashed curve obtained using the command Plot[{Cos[x],2*x/Pi^2+1/Pi},{x,-Pi/2,Pi/2},Frame->True, FrameLabel->{"x","F(x) = Cos(x) or p(x)"}, PlotStyle->{{Black},{Dashed,Black}}] in Mathematica 6.0. We now generate random variable obeying p.x/ D 2x= 2 C 1= in the interval =2 < x < C=2 using Equation (1.2): Z Z p.x/dx D u or, p.x/dx D u; a
=2
where u is random variable (of Table 1.1) of uniform probability density function in the interval 0 < x < 1. Thus, we have given by roots of the quadratic equation 2 C C . 2 =4
2 u/ D 0
which are D
=2 ˙ u1=2 :
Using D =2 C u1=2 in Microsoft Excel we have Table 2.5 in which we have evaluated the integral with the result 1.947 rather than 2. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other. Table 2.6 uses D =2 u1=2 . We h now take i up a normalized Gaussian variation for p.x/ given by p.x/ D 2 1 p Exp 21 x a where a is average and is variance of x . See Figure 2.6 in which we have 2 plotted F .x/ D Cos.x/ along with the normalized Gaussian probability density function p.x/.
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
53
Table 2.5: Showing tabulated values of ui , i D =2 C u1=2 i , Cos.i /=pi from which we F .xi / Cos.i / Cos.i / 1 PN 1 PN 1 PN get I D N i D1 p.xi / D N i D1 pi D N i D1 1=C2 = 2 as an approximate value of the i Rb R C=2 integral I D a F .x/dx D =2 Cos.x/dx D 1:947 whereas the exact value is 2. Using p.x/ D 2x= 2 C 1= . i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui ηi = –π/2 + πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 0.169 –0.279 3.673 0.050 –0.868 4.539 0.844 1.315 0.432 0.182 –0.231 3.585 0.599 0.861 1.323 0.985 1.547 0.037 0.726 1.106 0.826 0.148 –0.362 3.818 0.788 1.218 0.611 0.698 1.054 0.929 0.010 –1.257 4.854 0.397 0.409 2.288 0.852 1.329 0.407 0.761 1.170 0.703 0.309 0.176 2.782 0.113 –0.515 4.067 0.212 –0.124 3.385 0.809 1.255 0.543 0.084 –0.660 4.281 0.276 0.080 2.980 0.243 –0.022 3.186 0.989 1.553 0.027 0.508 0.668 1.730 0.817 1.269 0.517 0.174 –0.260 3.639
54
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui ηi = –π/2 + πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 0.225 –0.081 3.301 0.687 1.033 0.971 0.060 –0.801 4.462 0.070 –0.740 4.386 0.835 1.300 0.460 0.466 0.574 1.933 0.271 0.065 3.011 0.813 1.262 0.530 0.376 0.356 2.401 0.983 1.544 0.042 0.181 –0.234 3.591 0.583 0.828 1.391 0.612 0.887 1.269 0.468 0.578 1.923 0.614 0.891 1.260 0.768 1.182 0.679 0.811 1.258 0.536 0.461 0.562 1.957 0.985 1.547 0.037 0.735 1.123 0.794 0.559 0.778 1.496 0.884 1.383 0.312 0.229 –0.067 3.275 0.920 1.443 0.210 0.524 0.703 1.655
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui ηi = –π/2 + πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 0.393 0.399 2.309 0.306 0.167 2.800 0.819 1.272 0.510 0.620 0.903 1.236 0.875 1.368 0.338 0.773 1.191 0.662 0.492 0.633 1.806 0.332 0.239 2.648 0.185 –0.220 3.564 0.565 0.791 1.470 0.434 0.499 2.094 0.665 0.991 1.055 0.516 0.686 1.692 0.659 0.980 1.079 0.709 1.074 0.888 0.515 0.684 1.697 0.683 1.026 0.986 0.092 –0.618 4.221 0.417 0.458 2.182 0.598 0.859 1.327 0.682 1.024 0.990 0.948 1.488 0.133 0.125 –0.460 3.981 0.149 –0.358 3.811 0.246 –0.013 3.167
55
56
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
ui ηi = –π/2 + πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 0.231 –0.061 3.262 0.836 1.302 0.457 0.167 –0.287 3.687 0.545 0.748 1.559 0.748 1.146 0.748 0.440 0.513 2.063 0.674 1.008 1.020 0.287 0.112 2.914 0.052 –0.854 4.523 0.940 1.475 0.155 0.679 1.018 1.001 0.910 1.426 0.237 0.254 0.013 3.117 0.236 –0.045 3.230 0.854 1.332 0.401 0.877 1.371 0.332 0.483 0.613 1.849 0.117 –0.496 4.038 0.847 1.320 0.423 0.201 –0.162 3.458 0.294 0.133 2.872 0.071 –0.734 4.378 0.065 –0.770 4.424 0.740 1.132 0.776 0.954 1.498 0.117 Sum = 194.736 I = 1.947
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
57
Table 2.6: Showing tabulated values of ui , i D =2 u1=2 i , Cos.i /=pi from which we F .xi / Cos.i / Cos.i / 1 PN 1 PN 1 PN get I D N i D1 p.xi / D N i D1 pi D N i D1 1=C2 = 2 as an approximate value of the i Rb R C=2 integral I D a F .x/dx D =2 Cos.x/dx D 1:947 whereas the exact value is 2. Using p.x/ D 1= C 2x= 2 . i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ui ηi = –π/2 – πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 3.673 –2.862 0.169 4.539 –2.273 0.050 0.432 –4.457 0.844 3.585 –2.911 0.182 1.323 –4.002 0.599 0.037 –4.689 0.985 0.826 –4.248 0.726 3.818 –2.779 0.148 0.611 –4.360 0.788 0.929 –4.195 0.698 4.854 –1.885 0.010 2.288 –3.550 0.397 0.407 –4.471 0.852 0.703 –4.311 0.761 2.782 –3.317 0.309 4.067 –2.627 0.113 3.385 –3.017 0.212 0.543 –4.396 0.809 4.281 –2.481 0.084 2.980 –3.221 0.276 3.186 –3.119 0.243 0.027 –4.695 0.989 1.730 –3.810 0.508 0.517 –4.410 0.817 3.639 –2.881 0.174
58
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui ηi = –π/2 – πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 0.225 –3.061 3.301 0.687 –4.175 0.971 0.060 –2.340 4.462 0.070 –2.402 4.386 0.835 –4.442 0.460 0.466 –3.715 1.933 0.271 –3.206 3.011 0.813 –4.403 0.530 0.376 –3.497 2.401 0.983 –4.686 0.042 0.181 –2.907 3.591 0.583 –3.970 1.391 0.612 –4.028 1.269 0.468 –3.720 1.923 0.614 –4.032 1.260 0.768 –4.324 0.679 0.811 –4.400 0.536 0.461 –3.704 1.957 0.985 –4.689 0.037 0.735 –4.264 0.794 0.559 –3.920 1.496 0.884 –4.525 0.312 0.229 –3.074 3.275 0.920 –4.584 0.209 0.524 –3.845 1.655
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
i 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ui ηi = –π/2 – πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 2.309 –3.540 0.393 2.800 –3.309 0.306 0.510 –4.414 0.819 1.236 –4.044 0.620 0.338 –4.509 0.875 0.662 –4.333 0.773 1.806 –3.774 0.492 2.648 –3.381 0.332 3.564 –2.922 0.185 1.470 –3.932 0.565 2.094 –3.640 0.434 1.055 –4.133 0.665 1.692 –3.828 0.516 1.079 –4.121 0.659 0.888 –4.216 0.709 1.697 –3.825 0.515 0.986 –4.167 0.683 4.221 –2.524 0.092 2.182 –3.600 0.417 1.327 –4.000 0.598 0.990 –4.165 0.682 0.133 –4.630 0.948 3.981 –2.682 0.125 3.811 –2.783 0.149 3.167 –3.129 0.246
59
60
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
ui ηi = –π/2 – πui1/2 Cos(ηi)/pi = Cos(ηi)/(1/π + 2ηi /π2) 3.262 –3.081 0.231 0.457 –4.443 0.836 3.687 –2.855 0.167 1.559 –3.890 0.545 0.748 –4.288 0.748 2.063 –3.655 0.440 1.020 –4.150 0.674 2.914 –3.254 0.287 4.523 –2.287 0.052 0.155 –4.617 0.940 1.001 –4.160 0.679 0.237 –4.568 0.910 3.117 –3.154 0.254 3.230 –3.097 0.236 0.401 –4.474 0.854 0.332 –4.513 0.877 1.849 –3.754 0.483 4.038 –2.645 0.117 0.423 –4.462 0.847 3.458 –2.979 0.201 2.872 –3.274 0.294 4.378 –2.408 0.071 4.424 –2.372 0.065 0.776 –4.273 0.740 0.117 –4.639 0.954 Sum = 194.735 I = 1.947
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
61
F(x) = Cos(x) or Gaussian(x)
1.0 0.8 0.6 0.4 0.2 0.0 –1.5
–1.0
–0.5
0.0
0.5
1.0
1.5
x
Figure 2.6: Showing F .x/ D Cos.x/ as undashed curve and Gaussian p.x/ D h 2 i Exp 21 x a as dashed curve obtained using the command sig=0.5; a=0; p1=Plot[Cos[x],{x,-Pi/2,Pi/2},PlotStyle->{Black},Frame->True, FrameLabel->{"x","F(x)= Cos (x) or Gaussian (x)"}]; p2=Plot[(1/(sig*Sqrt[2*Pi]))*Exp[-0.5*((x-a)/sig)^2], {x,-Pi/2,Pi/2},PlotStyle->{Dashed,Black}]; Show[p1,p2] in Mathematica 6.0.
p1 2
As Figure 2.6 shows, the Gaussian probability density function p.x/ with a D 0 and D 0:5 is not too different from the function Cos.x/. Hence, it is ideal for use as p.x/. We now generate random variable G obeying " # 1 G a 2 1 p.G/ D p Exp 2 2 with a D 0 and D 0:5 using the tabulated values of random variable g of Table 1.4 obeying 1 1 g a 2 p.g/ D p Exp 2 2 for a D 0 and D 1. The connection is G D a C g D 0 C 0:5g . Using Table 2.7 in Microsoft Excel, we have evaluated the integral with the result 1.950 rather than 2. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other.
62
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
P Table 2.7: Showing tabulated values of ui , gi , Gi , Cos.Gi /=pi from which we get I D N1 N i D1 F .xi / Cos.Gi / Cos 1 PN 1 PN as an approximate value of the inte .Gi / D D i D1 i D1 p.xi / N pi N G a 2
1 p Exp 2
1 2
i
Rb R C=2 gral I D a F .x/dx D =2 Cos.x/dx D 1:950 whereas the exact value is 2. Using p.x/ D h 2 i p1 Exp 21 x a .
2
i
ui
gi
Gi
Cos Gi
pi
(Cos Gi)/pi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
–0.955 –1.635 1.015 –0.905 0.255 2.195 0.605 –1.040 0.805 0.520 –2.295 –0.255 1.050 0.715 –0.495 –1.205 –0.795 0.880 –1.370 –0.590 –0.695 2.325 0.020 0.910 –0.935
–0.478 –0.818 0.508 –0.453 0.128 1.098 0.303 –0.520 0.403 0.260 –1.148 –0.128 0.525 0.358 –0.248 –0.603 –0.398 0.440 –0.685 –0.295 –0.348 1.163 0.010 0.455 –0.468
0.888 0.684 0.874 0.899 0.992 0.456 0.955 0.868 0.920 0.966 0.411 0.992 0.865 0.937 0.970 0.824 0.922 0.905 0.774 0.957 0.940 0.397 1.000 0.898 0.893
0.506 0.210 0.477 0.530 0.772 0.072 0.664 0.465 0.577 0.697 0.057 0.772 0.460 0.618 0.706 0.386 0.582 0.542 0.312 0.670 0.627 0.053 0.798 0.527 0.515
1.756 3.263 1.833 1.698 1.284 6.354 1.437 1.868 1.594 1.387 7.168 1.284 1.882 1.516 1.373 2.134 1.585 1.670 2.481 1.427 1.500 7.425 1.254 1.703 1.732
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
i
ui
gi
Gi
Cos Gi
pi
(Cos Gi)/pi
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
–0.750 0.490 –1.540 –1.465 0.980 –0.085 –0.605 0.895 –0.315 2.145 –0.905 0.210 0.285 –0.080 0.290 0.735 0.885 –0.095 2.195 0.630 0.150 1.200 –0.740 1.415 0.060
–0.375 0.245 –0.770 –0.733 0.490 –0.043 –0.303 0.448 –0.158 1.073 –0.453 0.105 0.143 –0.040 0.145 0.368 0.443 –0.048 1.098 0.315 0.075 0.600 –0.370 0.708 0.030
0.931 0.970 0.718 0.744 0.882 0.999 0.955 0.902 0.988 0.478 0.899 0.994 0.990 0.999 0.990 0.933 0.904 0.999 0.456 0.951 0.997 0.825 0.932 0.760 1.000
0.602 0.708 0.244 0.273 0.494 0.795 0.664 0.535 0.759 0.080 0.530 0.780 0.766 0.795 0.765 0.609 0.539 0.794 0.072 0.654 0.789 0.388 0.607 0.293 0.796
1.545 1.371 2.945 2.725 1.787 1.257 1.437 1.686 1.301 5.978 1.698 1.274 1.292 1.256 1.293 1.532 1.676 1.258 6.354 1.453 1.264 2.125 1.537 2.592 1.255
63
64
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i
ui
gi
Gi
Cos Gi
pi
(Cos Gi)/pi
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
–0.270 –0.505 0.915 0.310 1.155 0.750 –0.020 –0.430 –0.890 0.165 –0.165 0.430 0.040 0.410 0.555 0.040 0.480 –1.320 –0.205 0.250 0.475 1.635 –1.145 –1.035 –0.685
–0.135 –0.253 0.458 0.155 0.578 0.375 –0.010 –0.215 –0.445 0.083 –0.083 0.215 0.020 0.205 0.278 0.020 0.240 –0.660 –0.103 0.125 0.238 0.818 –0.573 –0.518 –0.343
0.991 0.968 0.897 0.988 0.838 0.931 1.000 0.977 0.903 0.997 0.997 0.977 1.000 0.979 0.962 1.000 0.971 0.790 0.995 0.992 0.972 0.684 0.841 0.869 0.942
0.769 0.702 0.525 0.760 0.410 0.602 0.798 0.727 0.537 0.787 0.787 0.727 0.797 0.734 0.684 0.797 0.711 0.334 0.781 0.773 0.713 0.210 0.414 0.467 0.631
1.288 1.379 1.709 1.299 2.046 1.545 1.254 1.343 1.681 1.266 1.266 1.343 1.254 1.335 1.406 1.254 1.366 2.366 1.273 1.283 1.364 3.263 2.029 1.861 1.493
2.2. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE II
i
ui
gi
Gi
Cos Gi
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
–0.730 0.985 –0.960 0.115 0.670 –0.150 0.455 –0.560 –1.615 1.565 0.470 1.350 –0.660 –0.715 1.060 1.165 –0.040 –1.185 1.030 –0.835 –0.540 –1.460 –1.505 0.645 1.695
–0.365 0.493 –0.480 0.058 0.335 –0.075 0.228 –0.280 –0.808 0.783 0.235 0.675 –0.330 –0.358 0.530 0.583 –0.020 –0.593 0.515 –0.418 –0.270 –0.730 –0.753 0.323 0.848
0.934 0.881 0.887 0.998 0.944 0.997 0.974 0.961 0.691 0.709 0.973 0.781 0.946 0.937 0.863 0.835 1.000 0.830 0.870 0.914 0.964 0.745 0.730 0.948 0.662
pi
(Cos Gi)/pi
0.611 1.528 0.491 1.794 0.503 1.762 0.793 1.260 0.637 1.481 0.789 1.264 0.719 1.354 0.682 1.409 0.217 3.192 0.234 3.024 0.714 1.361 0.321 2.434 0.642 1.474 0.618 1.516 0.455 1.897 0.405 2.063 0.797 1.254 0.395 2.098 0.469 1.854 0.563 1.624 0.690 1.398 0.275 2.711 0.257 2.839 0.648 1.464 0.190 3.489 Sum = 195.012 I = 1.950
65
66
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
2.3
EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD: EXAMPLE III
As Example III, we now take up the integral I D
Z
b
F .x/dx D
a
Z
2
e x dx;
(2.7)
0
where F .x/ D e x . We re-write Equation (2.7) as I D
Z
b
a
F .x/ p.x/dx p.x/
(2.8)
which, as discussed in Section 1.7, implies that average value of F=p is the value of the integral, i.e., N 1 X F .xi / I D (2.9) ; N p.xi / i D1 where xi ’s are random values of x in the interval a < x < b obeying probability density function p.x/. We now take up a linear variation for p.x/ given by p.x/ D C x where C is a constant. R2 Normalization of p.x/ requires 0 p.x/dx D 1 or, C D 1=2. As such, normalized probability density function is p.x/ D x=2. See Figure 2.7 in which we have plotted F .x/ D e x along with the normalized linear probability density function p.x/ D x=2. The linear probability density function p.x/ D x=2 follows the function e x to some extent. Hence, it is not a bad choice. We now generate random variable obeying p.x/ D x=2 in the interval 0 < x < 2 using Equation (1.2): Z
a
p.x/dx D u;
where u is random variable (of Table 1.1) of uniform probability density function in the interval 0 < x < 1. Thus, we have D 2u1=2 . Using D 2u1=2 in Microsoft Excel we have Table 2.8 in which we have evaluated the integral with the result 6.234 rather than 6.39. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other. We now take up a normalized Gaussian variation for p.x/ given by 1 1 x a 2 p.x/ D p Exp ; 2 2 where a is average and is variance of x . See Figure 2.8 in which we have plotted F .x/ D e x along with the normalized Gaussian probability density function p.x/. As Figure 2.8 shows, the Gaussian probability density function p.x/ with a D 1 and D 0:3 is different from the
2.3. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE III
67
7
F(x) = e x or p(x)
6 5 4 3 2 1 0 0.0
0.5
1.0
x
1.5
2.0
Figure 2.7: Showing F .x/ D e x as undashed curve and p.x/ D x=2 as dashed curve obtained using the command Plot[{Exp[x],x/2},{x,0,2},Frame->True,FrameLabel-> {"x","F(x) = e^x or p(x)"},PlotStyle->{{Black},{Dashed, Black}}] in Mathematica 6.0.
F(x) = e x or Gaussian(x)
7 6 5 4 3 2 1 0
0.0
0.5
1.0
x
1.5
2.0
Figure 2.8: Showing F .x/ D e x as undashed curve and Gaussian p.x/ D h 2 i Exp 21 x a as dashed curve obtained using the command sig=0.3; a=1; p1=Plot[Exp[x],{x,0,2},PlotStyle->{Black},Frame->True, FrameLabel->{"x","F(x) = e^x or Gaussian (x)"},PlotRange->{0,7}]; p2=Plot[(1/(sig*Sqrt[2*Pi]))*Exp[-0.5*((x-a)/sig)^2], {x,0,7},PlotStyle->{Dashed,Black},PlotRange->{0,7}]; Show[p1,p2] in Mathematica 6.0.
p1 2
68
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i Table 2.8: Showing tabulated values of ui , i D 2u1=2 i , e =i from which we get I D P P P N N N F .xi / 1 1 e i 2 e i i D1 p.xi / D N i D1 i =2 D N i D1 i as an approximate value of the integral I D N Rb R2 x a F .x/dx D 0 e dx D 6:234 whereas the exact value is 6.389. Using p.x/ D x=2.
i
ui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
ηi = 2ui1/2 eηi /ηi 0.822 0.447 1.837 0.853 1.548 1.985 1.704 0.769 1.775 1.671 0.200 1.260 1.846 1.745 1.112 0.672 0.921 1.799 0.580 1.051 0.986 1.989 1.425 1.808 0.834
2.768 3.497 3.418 2.751 3.037 3.667 3.225 2.805 3.325 3.182 6.107 2.798 3.432 3.281 2.734 2.913 2.727 3.359 3.080 2.722 2.719 3.674 2.918 3.373 2.761
i
ui
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
ηi = 2ui1/2 eηi /ηi 0.949 1.658 0.490 0.529 1.828 1.365 1.041 1.803 1.226 1.983 0.851 1.527 1.565 1.368 1.567 1.753 1.801 1.358 1.985 1.715 1.495 1.880 0.957 1.918 1.448
2.722 3.165 3.332 3.208 3.403 2.869 2.721 3.366 2.780 3.663 2.752 3.015 3.056 2.871 3.058 3.292 3.363 2.863 3.667 3.240 2.983 3.487 2.721 3.550 2.938
2.3. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE III
i
ui
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
ηi = 2ui1/2 eηi /ηi 1.254 1.106 1.810 1.575 1.871 1.758 1.403 1.152 0.860 1.503 1.318 1.631 1.437 1.624 1.684 1.435 1.653 0.607 1.292 1.547 1.652 1.947 0.707 0.772 0.992
i
2.794 76 2.733 77 3.376 78 3.067 79 3.471 80 3.300 81 2.899 82 2.747 83 2.748 84 2.991 85 2.834 86 3.132 87 2.928 88 3.123 89 3.199 90 2.927 91 3.159 92 3.024 93 2.817 94 3.036 95 3.158 96 3.600 97 2.868 98 2.803 99 2.718 100
ui 0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
ηi = 2ui1/2 eηi /ηi 2.720 0.961 3.404 1.829 2.771 0.817 2.965 1.476 3.260 1.730 2.841 1.327 3.146 1.642 2.725 1.071 3.460 0.456 3.585 1.939 3.153 1.648 3.532 1.908 2.718 1.008 2.719 0.972 3.435 1.848 3.474 1.873 2.888 1.390 2.897 0.684 3.423 1.841 2.734 0.897 2.727 1.084 3.197 0.533 3.266 0.510 3.247 1.720 3.611 1.953 Sum = 311.710 I = 6.234
69
70
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
function e x in that it does not follow e x for x > 1. Hence, it is not expected to yield a good estimate of the value of the definite integral. Other values of yield worse results. We now generate random variable G obeying " # 1 1 G a 2 p.G/ D p Exp 2 2 with a D 1 and D 0:3 using the tabulated values of random variable g of Table 1.4 obeying 1 1 g a 2 p.g/ D p Exp 2 2 for a D 0 and D 1. The connection is G D a C g D 1 C 0:3g . Using Table 2.9 in Microsoft Excel, we have evaluated the integral with the result 5.154 rather than the exact value 6.389. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other for x > 1.
2.4
EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD: EXAMPLE IV
As Example IV, we now take up the integral I D
Z a
b
F .x/dx D
Z
5
1
loge xdx;
(2.10)
where F .x/ D loge x . We re-write Equation (2.10) as I D
Z
a
b
F .x/ p.x/dx p.x/
(2.11)
which, as discussed in Section 1.7, implies that average value of F=p is the value of the integral, i.e., N 1 X F .xi / I D ; (2.12) N p.xi / i D1 where xi ’s are random values of x in the interval a < x < b obeying probability density function p.x/. We now take up an exponential variation for p.x/ given by p.x/ D C e x where C is a R5 constant. Normalization of p.x/ requires 1 p.x/dx D 1 or, C D 1=145. As such, normalized probability density function is p.x/ D e x =145. See Figure 2.9 in which we have plotted F .x/ D loge x along with the normalized probability density function p.x/ D e x =145. The probability density function p.x/ D e x =145 follows the function loge x well. Hence, it is a good choice.
2.4. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE IV
71
Table 2.9: Showing tabulated values of ui , gi , Gi , e Gi , pi , e Gi =pi from which we get I D G F .xi / 1 PN 1 PN 1 PN e Gi e i as an approximate value of the i D1 p.xi / D N i D1 pi D N i D1 N G a 2 integral I D h p1 Exp 2
Rb
a F .x/dx i 1 x a 2 , 2
D
R2 0
1 p Exp 2
1 2
i
e x dx D 5:154 whereas the exact value is 6.389. Using p.x/ D
a D 1 and D 0:3.
i
ui
gi
Gi
eGi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
–0.955 –1.635 1.015 –0.905 0.255 2.195 0.605 –1.040 0.805 0.520 –2.295 –0.255 1.050 0.715 –0.495 –1.205 –0.795 0.880 –1.370 –0.590 –0.695 2.325 0.020 0.910 –0.935
0.714 0.510 1.305 0.729 1.077 1.659 1.182 0.688 1.242 1.156 0.312 0.924 1.315 1.215 0.852 0.639 0.762 1.264 0.589 0.823 0.792 1.698 1.006 1.273 0.720
2.041 1.664 3.686 2.072 2.934 5.251 3.259 1.990 3.461 3.177 1.365 2.518 3.725 3.369 2.343 1.894 2.141 3.540 1.802 2.277 2.207 5.460 2.735 3.572 2.053
pi
eGi /pi
0.843 2.422 0.349 4.764 0.794 4.639 0.883 2.347 1.287 2.280 0.120 43.925 1.107 2.943 0.774 2.570 0.962 3.598 1.162 2.735 0.096 14.296 1.287 1.956 0.766 4.861 1.030 3.271 1.176 1.992 0.643 2.943 0.969 2.209 0.903 3.920 0.520 3.464 1.117 2.038 1.044 2.113 0.089 61.269 1.330 2.057 0.879 4.063 0.859 2.391
72
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i
ui
gi
Gi
eGi
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
–0.750 0.490 –1.540 –1.465 0.980 –0.085 –0.605 0.895 –0.315 2.145 –0.905 0.210 0.285 –0.080 0.290 0.735 0.885 –0.095 2.195 0.630 0.150 1.200 –0.740 1.415 0.060
0.775 1.147 0.538 0.561 1.294 0.975 0.819 1.269 0.906 1.644 0.729 1.063 1.086 0.976 1.087 1.221 1.266 0.972 1.659 1.189 1.045 1.360 0.778 1.425 1.018
2.171 3.149 1.713 1.752 3.647 2.650 2.267 3.556 2.473 5.173 2.072 2.895 2.961 2.654 2.965 3.389 3.545 2.642 5.251 3.284 2.843 3.896 2.177 4.156 2.768
pi
eGi /pi
1.004 2.162 1.179 2.670 0.406 4.215 0.455 3.852 0.823 4.433 1.325 2.000 1.107 2.047 0.891 3.991 1.265 1.954 0.133 38.822 0.883 2.347 1.301 2.226 1.277 2.319 1.326 2.002 1.275 2.326 1.015 3.339 0.899 3.944 1.324 1.996 0.120 43.925 1.090 3.011 1.315 2.162 0.647 6.019 1.011 2.153 0.489 8.504 1.327 2.085
2.4. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE IV
i
ui
gi
Gi
eGi
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
–0.270 –0.505 0.915 0.310 1.155 0.750 –0.020 –0.430 –0.890 0.165 –0.165 0.430 0.040 0.410 0.555 0.040 0.480 –1.320 –0.205 0.250 0.475 1.635 –1.145 –1.035 –0.685
0.919 0.849 1.275 1.093 1.347 1.225 0.994 0.871 0.733 1.050 0.951 1.129 1.012 1.123 1.167 1.012 1.144 0.604 0.939 1.075 1.143 1.491 0.657 0.690 0.795
2.507 2.336 3.577 2.983 3.844 3.404 2.702 2.389 2.081 2.856 2.587 3.093 2.751 3.074 3.211 2.751 3.139 1.829 2.556 2.930 3.135 4.439 1.928 1.993 2.213
pi
eGi /pi
1.282 1.955 1.171 1.996 0.875 4.088 1.267 2.354 0.683 5.632 1.004 3.391 1.330 2.032 1.212 1.971 0.895 2.326 1.312 2.177 1.312 1.972 1.212 2.551 1.329 2.070 1.223 2.514 1.140 2.816 1.329 2.070 1.185 2.649 0.556 3.288 1.302 1.963 1.289 2.273 1.188 2.639 0.349 12.706 0.690 2.793 0.778 2.560 1.052 2.105
73
74
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
i
ui
gi
Gi
eGi
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
–0.730 0.985 –0.960 0.115 0.670 –0.150 0.455 –0.560 –1.615 1.565 0.470 1.350 –0.660 –0.715 1.060 1.165 –0.040 –1.185 1.030 –0.835 –0.540 –1.460 –1.505 0.645 1.695
0.781 1.296 0.712 1.035 1.201 0.955 1.137 0.832 0.516 1.470 1.141 1.405 0.802 0.786 1.318 1.350 0.988 0.645 1.309 0.750 0.838 0.562 0.549 1.194 1.509
2.184 3.653 2.038 2.814 3.323 2.599 3.116 2.298 1.674 4.347 3.130 4.076 2.230 2.194 3.736 3.855 2.686 1.905 3.702 2.116 2.312 1.754 1.731 3.299 4.520
pi
eGi /pi
1.019 2.143 0.819 4.462 0.839 2.430 1.321 2.130 1.062 3.128 1.315 1.976 1.199 2.599 1.137 2.021 0.361 4.639 0.391 11.124 1.191 2.629 0.535 7.623 1.070 2.085 1.030 2.130 0.758 4.927 0.675 5.715 1.329 2.021 0.659 2.891 0.782 4.732 0.938 2.255 1.149 2.011 0.458 3.830 0.428 4.039 1.080 3.054 0.316 14.296 Sum = 515.351 I = 5.154
2.5. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE V
75
F(x) = Log(x) or p(x)
1.5
1.0
0.5
0.0 1
2
3
4
x
5
Figure 2.9: Showing F .x/ D loge x as undashed curve and p.x/ D e x =145 as dashed curve obtained using the command a=1/145; p1=Plot[Log[E,x],{x,1,5},Frame->True, FrameLabel->{"x","F(x) = Log(x) or p(x)"},PlotStyle->{Black}]; p2=Plot[a*Exp[x],{x,1,5},PlotStyle->{Dashed,Black},Frame->True, FrameLabel->{"x","F(x) = e^x or Gaussian (x)"}];Show[p1,p2] in Mathematica 6.0. We now generate random variable obeying p.x/ D e x =145 in the interval 1 < x < 5 using Equation (1.2): Z Z p.x/dx D u or, p.x/dx D u; a
1
where u is random variable (of Table 1.1) of uniform probability density function in the interval 0 < x < 1. Thus, we have given by D loge .145u C 2:72/. Using D loge .145u C 2:72/ in Microsoft Excel we have Table 2.10 in which we have evaluated the integral with the result 3.915 rather than 4.05. The difference is attributable to the fact that F .x/ and p.x/ used are not proportional to each other.
2.5
EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD: EXAMPLE V
As Example V, we now take up the integral I D
Z a
b
F .x/dx D
Z 0
3
1 dx; 1 C x2
(2.13)
76
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
Table 2.10: Showing tabulated values of ui , i D loge .145ui C 2:72/, loge i =e i from which P loge i loge i F .xi / 1 PN 145 PN we get I D N1 N as an approximate value of iD1 p.xi / D N i D1 e i =145 D N i D1 e i R5 Rb the integral I D a F .x/dx D 1 loge xdx D 3:915 whereas the exact value is 4.045. Using p.x/ D e x =145. i
ui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
Loge ηi ηi = Loge (145ui + 2.72) — e ηi 0.046 3.237 0.091 2.109 0.013 4.812 0.044 3.308 0.017 4.473 0.011 4.965 0.015 4.663 0.051 3.110 0.014 4.744 0.015 4.624 –0.045 0.896 0.024 4.068 0.013 4.822 0.014 4.710 0.029 3.822 0.060 2.854 0.039 3.455 0.013 4.770 0.072 2.577 0.032 3.712 0.035 3.588 0.011 4.969 0.020 4.310 0.013 4.780 0.045 3.265
i
ui
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
Loge ηi ηi = Loge (145ui + 2.72) — e ηi 0.037 3.513 0.015 4.608 0.085 2.271 0.079 2.410 0.013 4.802 0.021 4.225 0.032 3.694 0.013 4.775 0.025 4.014 0.011 4.963 0.044 3.303 0.017 4.446 0.017 4.494 0.021 4.229 0.017 4.497 0.014 4.719 0.013 4.773 0.021 4.215 0.011 4.965 0.014 4.675 0.018 4.405 0.012 4.858 0.037 3.530 0.012 4.898 0.019 4.341
2.5. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE V
i
ui
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
Loge ηi i ηi = Loge (145ui + 2.72) — e ηi 76 0.024 4.058 77 0.030 3.812 78 0.013 4.782 79 0.017 4.507 80 0.012 4.848 81 0.014 4.725 82 0.020 4.279 83 0.028 3.892 84 0.043 3.324 85 0.018 4.415 86 0.022 4.155 87 0.016 4.576 88 0.019 4.326 89 0.016 4.567 90 0.015 4.640 91 0.019 4.324 92 0.015 4.603 93 0.068 2.661 94 0.023 4.116 95 0.017 4.471 96 0.015 4.601 97 0.012 4.927 98 0.057 2.949 99 0.050 3.116 0.035 100 3.600
ui 0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
Loge ηi ηi = Loge (145ui + 2.72) — e ηi 0.037 3.539 0.013 4.803 0.047 3.225 0.018 4.380 0.014 4.693 0.022 4.169 0.015 4.589 0.031 3.750 0.089 2.143 0.012 4.919 0.015 4.597 0.012 4.887 0.034 3.631 0.036 3.559 0.013 4.824 0.012 4.850 0.020 4.260 0.059 2.887 0.013 4.816 0.041 3.404 0.030 3.773 0.078 2.423 0.082 2.343 0.014 4.682 0.011 4.934 Sum = 2.700 I = 3.915
77
78
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
F(x) = 1/(1 + x 2) or p(x)
1.0 0.8 0.6 0.4 0.2 0.0 0.0
0.5
1.0
1.5
x
2.0
2.5
3.0
1 x Figure 2.10: Showing F .x/ D 1Cx as dashed curve 2 as undashed curve and p.x/ D 1:05e obtained using the command p1=Plot[1/(1+x^2),{x,0,3},PlotRange->{0,1},Frame->True, FrameLabel-> {"x","F(x) = 1/(1+x^2) or p(x)"},PlotStyle->{Black}]; p2=Plot[1.05*Exp[-x],{x,0,3},PlotStyle->{Dashed,Black}]; Show[p1,p2] in Mathematica 6.0.
where F .x/ D
1 . 1Cx 2
We re-write Equation (2.13) as I D
Z a
b
F .x/ p.x/dx p.x/
(2.14)
which, as discussed in Section 1.7, implies that average value of F=p is the value of the integral, i.e., N 1 X F .xi / ; I D N p.xi /
(2.15)
i D1
where xi ’s are random values of x in the interval a < x < b obeying probability density function p.x/. We now take up an exponential variation for p.x/ given by p.x/ D C e x where C is R3 a constant. Normalization of p.x/ requires 0 p.x/dx D 1 or, C D 1:05. As such normalized probability density function is p.x/ D 1:05e x . See Figure 2.10 in which we have plot1 x . The ted F .x/ D 1Cx 2 along with the normalized probability density function p.x/ D 1:05e 1 x probability density function p.x/ D 1:05e follows the function 1Cx 2 quite well. Hence, it is a very good choice.
2.5. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE V
79
x
We now generate random variable obeying p.x/ D 1:05e in the interval 0 < x < 3 using Equation (1.2): Z Z p.x/dx D u or, p.x/dx D u; a
0
where u is random variable (of Table 1.1) of uniform probability density function in the interval 0 < x < 1. Thus, we have given by D loge .1 0:95u/. Using D loge .1 0:95u/ in Microsoft Excel we have Table 2.11 in which we have evaluated the integral with the result 1.251 while the exact value is also 1.249. The absence of difference is attributable to the fact that F .x/ and p.x/ used are almost proportional to each other.
80
2. EVALUATION OF DEFINITE INTEGRALS USING THE MONTE CARLO METHOD
Table 2.11: Showing tabulated values of ui , i D loge .1 0:95ui /, e i =.1 C 2i / from which P 1=.1Ci2 / F .xi / 1 PN 0:95 PN e i we get I D N1 N i D1 p.xi / D N i D1 1:05e i D N i D1 .1C 2 / as an approximate value i Rb R3 1 of the integral I D a F .x/dx D 0 1Cx 2 dx D 1:251 whereas the exact value is 1.249. Using p.x/ D 1:05e x . i
ui
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
e ηi ηi = –Loge (1 – 0.95ui ) — i (1 + ηi 2) 0.175 0.049 1.617 0.190 0.841 2.743 1.169 0.151 1.380 1.087 0.010 0.473 1.657 1.283 0.347 0.113 0.225 1.462 0.083 0.304 0.262 2.804 0.659 1.496 0.181
1.156 1.047 1.394 1.167 1.358 1.822 1.360 1.137 1.369 1.359 1.009 1.311 1.400 1.363 1.263 1.106 1.192 1.375 1.079 1.241 1.216 1.863 1.348 1.379 1.160
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
ui 0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
e ηi ηi = –Loge (1 – 0.95ui ) — (1 + ηi 2) 0.240 1.057 0.059 0.069 1.575 0.584 0.297 1.479 0.442 2.714 0.189 0.807 0.870 0.588 0.875 1.307 1.471 0.576 2.743 1.197 0.757 1.830 0.245 2.070 0.688
1.202 1.359 1.057 1.066 1.388 1.337 1.237 1.377 1.301 1.804 1.166 1.357 1.359 1.338 1.359 1.364 1.376 1.336 1.822 1.361 1.355 1.433 1.205 1.500 1.351
2.5. EVALUATION OF DEFINITE INTEGRALS: EXAMPLE V
i
ui
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
e ηi ηi = –Loge (1 – 0.95ui ) — (1 + ηi 2) 0.467 0.343 1.504 0.889 1.778 1.325 0.630 0.379 0.193 0.769 0.531 0.998 0.673 0.983 1.119 0.671 1.046 0.091 0.504 0.839 1.043 2.307 0.126 0.153 0.266
1.310 1.261 1.379 1.359 1.422 1.365 1.344 1.277 1.169 1.356 1.327 1.359 1.349 1.359 1.359 1.349 1.359 1.087 1.320 1.358 1.359 1.589 1.117 1.138 1.219
i
ui
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
e ηi ηi = –Loge (1 – 0.95ui ) — (1 + ηi 2) 0.248 1.580 0.173 0.729 1.239 0.541 1.022 0.318 0.051 2.234 1.035 1.998 0.276 0.254 1.667 1.790 0.614 0.118 1.632 0.212 0.327 0.070 0.064 1.213 2.366
1.207 1.389 1.154 1.354 1.362 1.329 1.359 1.248 1.049 1.558 1.359 1.477 1.225 1.211 1.401 1.425 1.342 1.110 1.396 1.183 1.253 1.067 1.061 1.361 1.615 Sum = 131.670 I = 1.251
81
83
CHAPTER
3
Variational Monte Carlo Method Applied to the Ground State of a Simple Harmonic Oscillator 3.1
THE VARIATIONAL METHOD OF QUANTUM MECHANICS APPLIED TO THE GROUND STATE OF ANY QUANTUM MECHANICAL SYSTEM
Let ‰0 , ‰1 , ‰2 , ‰3 ; : : : ; ‰N be exact, unknown, orthonormal eigenfunctions of known Hamiltonian H . Let E0 < E1 < E2 < E3 < : : : < EN be exact, unknown eigenvalues of energy, respectively. That is, we have eigenvalue equation H ‰n D En ‰n
(3.1)
which we cannot solve. Suppose we wish to estimate E0 and we wish to know approximate form of ‰0 . Let us choose by guess a suitable function ˆ0 that is expected to resemble unknown ‰0 and write N X Cn.0/ ‰n (3.2) ˆ0 D nD0
and let us evaluate the quantity Eˆ0 given by
84
3. VARIATIONAL MONTE CARLO METHOD
R ˆ Hˆ0 d .ˆ0 ; Hˆ0 / D R 0 .ˆ0 ; ˆ0 / ˆ0 ˆ0 d P P .0/ .0/ C ‰ ; H C ‰ m n m n mD0 nD0 P P .0/ .0/ mD0 Cm ‰m ; nD0 Cn ‰n P P .0/ .0/ C ‰ ; C H ‰ m n m n mD0 nD0 P P .0/ .0/ C ‰ ; C ‰ m n mD0 m nD0 n P P .0/ .0/ mD0 Cm ‰m ; nD0 Cn En ‰n P P .0/ .0/ C ‰ ; C ‰ m n mD0 m nD0 n
Eˆ0 D D
D
D
(3.3)
using Equation (3.1) D
P
mD0
P
P
nD0
P
Cm.0/ Cn.0/ En .‰m ; ‰n /
Cm.0/ Cn.0/ .‰m ; ‰n / ˇ ˇ P ˇ .0/ ˇ2 P P .0/ .0/ C ˇ ˇ En n nD0 mD0 nD0 Cm Cn En ımn D P D ˇ ˇ : P .0/ .0/ P ˇ .0/ ˇ2 mD0 nD0 Cm Cn ımn C ˇ ˇ n nD0
Thus,
mD0
nD0
ˇ ˇ ˇ .0/ ˇ2 ˇCn ˇ .En E0 / E0 D : (3.4) Eˆ0 E0 D ˇ ˇ P ˇ .0/ ˇ2 nD0 ˇCn ˇ ˇ ˇ2 ˇ ˇ In Equation (3.4), En E0 . ) En E0 0; moreover, ˇCn.0/ ˇ 0. Thus, Equation (3.4) shows that Eˆ0 E0 0 or, Eˆ0 E0 . We find that for arbitrary ˆ0 , calculated value of Eˆ0 E0 i.e., Eˆ0 is larger than or equal to ground state energy E0 . Eˆ0 gives upper bound of ground state energy E0 . If chosen ˆ0 is different from actual unknown ‰0 , calculated value of Eˆ0 calculated using Equation (3.3) will be larger than E0 . If chosen ˆ0 happens to be same as unknown ‰0 , value of Eˆ0 calculated using Equation (3.3) becomes equal to E0 . Thus, we can choose arbitrary ˆ0 and calculate Eˆ0 using Equation (3.3) and get upper bound of E0 . Usually we choose a suitable ˆ0 known as trail function containing one or more adjustable parameters ˛i.0/ ’s, e.g., ˇ ˇ ˇ .0/ ˇ2 ˇCn ˇ En ˇ ˇ P ˇ .0/ ˇ2 nD0 ˇCn ˇ
P
P
nD0
ˆ0 D e
nD0
.0/
˛1 x
;
3.2. THE VARIATIONAL METHOD OF QUANTUM MECHANICS
85
˛1.0/
where is an adjustable parameter. Then we use this expression of ˆ0 in Equation (3.3) and @E 0 calculated expression of Eˆ0 will contain the parameters ˛i.0/ ’s. We then stipulate ˆ .0/ D 0 for @˛i
˛i.0/ ,
˛i.0/ ’s
each separately. We thus get values of for which Eˆ0 is minimum. We can put these .0/ values of ˛i ’s in the expression of Eˆ0 . We then get the lowest value of Eˆ0 for the chosen ˆ0 . This upper bound to E0 will be close to actual unknown value of E0 if trail function ˆ0 has a form closely resembling that of actual unknown ‰0 . The entire process is repeated for several different functions as ˆ0 to see which function leads to much lower value of Eˆ0 . If we are happy that a calculated value of Eˆ0 is low enough and that it is likely to be close to actual unknown value of E0 , we can take E0 Eˆ0 and ‰0 ˆ0 within some approximation.
3.2
THE VARIATIONAL METHOD OF QUANTUM MECHANICS APPLIED TO THE GROUND STATE OF A SIMPLE HARMONIC OSCILLATOR
Suppose we know Hamiltonian operator H D
1 „2 d 2 C m!c2 x 2 2 2m dx 2
of a simple harmonic oscillator and we do not know eigenfunctions ‰n and eigenvalues En of H , because suppose we cannot solve eigenvalue equation H ‰n D En ‰n of the operator H . Suppose we wish to estimate ground state energy E0 and wish to know approximate form of corresponding eigenfunction ‰0 . 2 Let us choose ˆ0 D e ˛x by guessing as an approximate form of ‰0 and let us evaluate the quantity .ˆ0 ; Hˆ0 / Eˆ0 D : (3.5) .ˆ0 ; ˆ0 / Now Z C/ Z C/ 2 2 2 2 2 .ˆ0 ; ˆ0 / D e ˛x ; e ˛x D e ˛x e ˛x dx D e 2˛x dx / / Z Z Z C/ 1 C/ 1 2˛x 2 2 1 C/ 1 2˛x 2 2xdx D dx D x e x e x 1e D 2 / 2 / 0 Z C/ Z C/ 1=2 1 2˛x 2 2 1=2 2˛x 2 2 dx D .2˛/ dx D x2 e D x2 e 0 0 r Z C/ p 1=2 D .2˛/ using x n 1 e ax dx D a n n; D 2˛ 0
where stands for a well-known Gamma function.
2˛x 2
1=2
dx 2
.1=2/
86
3. VARIATIONAL MONTE CARLO METHOD
Thus, .ˆ0 ; ˆ0 / D
We also note that
Z
C/
e
2˛x 2
0
r
: 2˛
1 dx D 2
(3.6)
r
: 2˛
(3.7)
We now turn to .ˆ0 ; Hˆ0 /. H D T C V where T is operator of kinetic energy and V is operator of potential energy. .ˆ0 ; Hˆ0 / D .ˆ0 ; .T C V /ˆ0 / D ˆ0 ;
„2 d 2 ˆ0 1 2 2 C m!c x ˆ0 : 2m dx 2 2
(3.8)
Now 1 2 2 2 2 ˛x 2 ˛x 2 1 .ˆ0 ; V ˆ0 / D ˆ0 ; m!c x ˆ0 D e ; m!c x e 2 2 Z C/ Z C/ 1 1 2 ˛x 2 ˛x 2 2 2 2 2 2˛x 2 D m!c ;x e dx D m!c x2e D m!c e x e 2 2 0 / Z C/ Z C/ 1=2 2˛x 2 1 1 2 2˛x 2 2 D m!c 2xdx D m!c d x2 xe x2 e 2 2 0 0 Z C/ 1 1 2 3=2 1 D m!c2 x2 e 2˛x d x 2 D m!c2 .2˛/ 3=2 .3=2/ 2 2 0 r p 1 1 m!c2 D m!c2 .2˛/ 3=2 .1=2/.1=2/ D m!c2 .2˛/ 3=2 .1=2/ D ; 2 2 8˛ 2˛
2˛x 2
dx
using Z
C/
xn
1
e
ax
0
dx D a
n
n
and
Thus, m!c2 .ˆ0 ; V ˆ0 / D 8˛
We also note that
Z 0
C/
2
x e
2˛x 2
r
1 dx D 8˛
.n C 1/ D nn:
: 2˛ r
: 2˛
(3.9)
(3.10)
3.2. THE VARIATIONAL METHOD OF QUANTUM MECHANICS
87
Now .ˆ0 ; T ˆ0 / D ˆ0 ; D e
D D D D D D
˛x 2
„2 d 2 ˆ 0 2m dx 2 ;
„2 d 2 e 2m dx 2
˛x 2
„2 e 2m
D
˛x 2
d2 ; 2e dx
˛x 2
Z Z „2 C/ ˛x 2 d 2 ˛x 2 „2 C/ ˛x 2 d 2 ˛x 2 e e e e dx D dx 2m / dx 2 m 0 dx 2 Z „2 C/ ˛x 2 d 2 e 2˛xe ˛x dx m 0 dx 2 Z C/ „ 2 2 2 e ˛x 2˛e ˛x 2˛x. 2˛x/e ˛x dx m 0 Z „2 C/ ˛x 2 2 2 e 2˛e ˛x C 4˛ 2 x 2 e ˛x dx m 0 Z C/ Z C/ „2 2 2 2˛x 2 2˛x 2 dx 2˛ dx C 4˛ x e e m 0 0 r r r r „2 ˛i „2 ˛ 1 „2 h 2 1 C 4˛ ˛C D ; 2˛ D m 2 2˛ 8˛ 2˛ m 2 2˛ 2m 2˛
using Equations (3.7) and (3.10). Thus, „2 ˛ .ˆ0 ; T ˆ0 / D 2m
r
: 2˛
(3.11)
From Equations (3.11) and (3.9), we gather that 2 r „ ˛ m!c2 .ˆ0 ; Hˆ0 / D .ˆ0 ; .T C V /ˆ0 / D C : 2m 8˛ 2˛ Using Equations (3.12) and (3.6) in Equation (3.5), we get 2 r „ ˛ m!c2 C .ˆ0 ; Hˆ0 / „2 ˛ m!c2 2m 8˛ 2˛ D C : Eˆ0 D D r .ˆ0 ; ˆ0 / 2m 8˛ 2˛
Eˆ0
We now stipulate that for
@Eˆ0 @˛
D 0. Hence, ˛D
„2 2m
m!c 2„
m!c2 8˛ 2
(3.12)
(3.13)
D 0. Thus, we get lowest value of
(3.14)
88
3. VARIATIONAL MONTE CARLO METHOD
for the chosen ˆ0 .D e of
˛x 2
). Using Equation (3.14) in Equation (3.13), we get the lowest value
Eˆ0 D
m!c2 „2 m!c m! 2 „2 ˛ C D C m!cc : 2m 8˛ 2m 2„ 8 2„
We take ground state energy as E0 Eˆ0 D
1 „!c : 2
(3.15)
This incidentally agrees exactly with known value of ground state energy E0 of simple harmonic 2 oscillator. The ground state eigenfunction ˆ0 D e ˛x becomes ‰0 ˆ0 D e
1 m!c 2 „
x2
(3.16)
which incidentally agrees exactly with known ground state eigenfunction ‰0 of energy of simple harmonic oscillator. Thus, to some extent, we have become familiar with use of the variational method.
3.3
GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR USING THE MONTE CARLO METHOD
We consider an electron residing in a simple harmonic oscillator potential V .x/ D
1 1 m!c2 x 2 D kx 2 : 2 2
(3.17)
We first gather exact results from Quantum Mechanics books. Eigenvalue equation of energy is H ‰ D E‰ , or 1 „2 d 2 2 2 C m! x ‰ D E‰: (3.18) c 2m dx 2 2 Eigenvalues of energy are En D .n C 1=2/„!c ;
(3.19)
where n D 0; 1; 2; 3; : : :. Ground state energy in unit of „!c is E0 =.„!c / D 0:5 and ground state eigenfunction is 1 m!c 2 1 2 ‰0 D e 2 „ x D e 2 Lx ; (3.20) where
m!c : (3.21) „ We now gather results from variational method of Quantum Mechanics detailed in Section 3.2: for trial wavefunction 2 2 ˆ0 D e ˛x D e ˇLx ; LD
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
89
ground state energy estimated or evaluated using Equation (3.5): .ˆ0 ; Hˆ0 / .ˆ0 ; ˆ0 /
Eˆ0 D
is E0 =.„!c / D 0:5 and value of ˇ turns out to be 0.5 so that ground state eigenfunction is ˆ0 D e
˛x 2
ˇLx 2
De
1 2 2 Lx
De
(3.22)
:
We now move onto variational Monte Carlo method of evaluating ground state eigenvalue and eigenfunction of energy. We have Hamiltonian operator „2 d 2 1 C m!c2 x 2 2m dx 2 2
H D
or, H D ˛x 2
which together with trial wavefunction ˆ0 D e Hˆ0 D He
˛x 2
D
„2 2m
„2 d 2 1 C kx 2 2m dx 2 2
lead to
2˛ C 4˛ 2 x 2 e
˛x 2
1 C kx 2 e 2
˛x 2
or, Hˆ0 D ˆ0
„2 2m
1 2˛ C 4˛ 2 x 2 C kx 2 2
(3.23)
and ground state energy in unit of „!c as E0 .ˆ0 ; Hˆ0 / D D „!c „!c .ˆ0 ; ˆ0 / D
Z
F .x/dx D
D< f >D
: „!c ˆ0
Thus, average or the so-called expectation value of energy in unit of „!c . Here,
(3.24)
1 Hˆ0 „!c ˆ0
is a good estimate of ground state
1 Hˆ0 „! ˆ0 rc 2˛ 2 ˆ p.x/ D 0
(3.25)
f D
and F .x/ D
1 Hˆ0 „!c ˆ0
(3.26) r
! 2˛ 2 ˆ : 0
(3.27)
90
3. VARIATIONAL MONTE CARLO METHOD
Looking at Equation (3.24), ground state energy in unit of „!c is 1 E0 1 Hˆ0 1 „2 2˛ C 4˛ 2 x 2 C kx 2 > D< >D < „!c „!c ˆ0 „!c 2m 2 1 k „ x2 > 2˛ C 4˛ 2 x 2 C D< 2m!c 2 „!c
using Equation (3.23), or E0 D< „!c
using
k „!c
L 2˛ C 4˛ 2 x 2 C x 2 > 2
1 2L
D L obtained as follows: L2 D
m2 !c2 ; „2
L2 D
m2 k ; „2 m
see Equation (3.21), or
see Equation (3.17), or
(3.28)
p mk LD : „
Again,
p r k m mk k D D L: D „!c „ k „ c In Equation (3.28), ˛ D ˇL and L D m! . We note that ground state energy is given by „ E0 D< „!c
1 2L
L 2˛ C 4˛ 2 xi2 C xi2 >; 2
(3.29)
where xi ’s are random values of x obeying the Gaussian probability density function p.x/ given by Equation (3.26). Before we proceed to evaluate ground state energy using the prescription of Equation (3.29), we present expressions for F .x/ and p.x/ and plot them together to ascertain that they follow each other. As demonstrated in Section 1.7, p.x/ at least should follow F .x/, if not be proportional to F .x/ to get good result. According to Equation (3.26), r 2˛ 2˛x 2 (3.30) p.x/ D e which is Gaussian function of x given by p.x/ D
1 p e 2
1 2
2
. x a / :
(3.31)
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
91
F(x) or Gaussian(x)
1.0 0.8 0.6 0.4 0.2 0.0 –15
–10
–5
0
5
10
15
L 2 x 2
q 2˛
2˛x 2
x
Figure 3.1: Showing F .x/ D
1 . 2L
2 2
2˛ C 4˛ x / C h as undashed curve and Gaussian p.x/ D p1 Exp
2
1 2
x
i a 2
e
of Equation (3.33)
of Equation (3.31) as dashed
curve obtained using Program 3.1. For chosen value of spring constant k D 10 18 that correc D 9:046 109 , ˇ D 0:8, ˛ D ˇL D 7:237 109 , a D 0, sponds to !c D 1.048 MHz, L D m! „ D 12 ˛ 1=2 D 5:878 10 6 . (Here x is in unit of 10 6 and F .x/ and p.x/ are in unit of 10 5 ). Comparison between Equations (3.30) and (3.31) shows that a D 0 and D
1 ˛ 2
1=2
(3.32)
:
And, according to Equation (3.27), F .x/ D
1 Hˆ0 „!c ˆ0
r
2˛ 2 ˆ 0
!
or F .x/ D
1 2L
2˛ C 4˛ 2 x
2
L C x2 2
r
2˛ e
2˛x 2
!
(3.33)
using Equation (3.28). Using Program 3.1 in Mathematica 6.0, we plotted Figure 3.1 to ascertain that F .x/ and p.x/ follow each other. We have chosen “spring constant” k D 10 18 that corresponds to !c D 1:048 MHz. We find that F .x/ and p.x/ follow each other very well and, hence, Equation (3.29) E0 will give a good estimate of „! . c
92
3. VARIATIONAL MONTE CARLO METHOD
Program 3.1
beta=0.8; k=10^-18; m=9.1*10^-31; hcut=(6.626*10^-34)/(2*3.1416); omega=Sqrt[k/m] L=m*omega/hcut alpha=beta*L; a=0; sig=0.5*((beta*L)^(-0.5)) F=Plot[(10^-5)*((-1/(2*L))*(-2*alpha+4*alpha^2*(x*(10^-6))^2) +0.5*L*(x*(10^-6))^2)*(Sqrt[2*alpha/3.1416])* Exp[-2*alpha*(x*(10^-6))^2], {x,-3*sig/(10^-6), +3*sig/(10^-6)},PlotStyle->{Black},Frame->True, FrameLabel->{"x","F(x) or Gaussian (x)"},PlotRange->{0,1}]; p=Plot[(10^-5)*(Sqrt[2*alpha/3.1416])*Exp[-2*alpha*(x*(10^-6))^2], {x,-3*sig/(10^-6),+3*sig/(10^-6)},PlotStyle->{Dashed,Black}, PlotRange->{0,1}]; Show[F,p]
We now generate random variables G obeying 1 p.G/ D p Exp 2
with a D 0 and D 5:878 10 obeying
6
"
1 2
G
a
2 #
using the tabulated values of random variable g of Table 1.4
p.g/ D
1 p Exp 2
1 g a 2 2
for a D 0 and D 1. The connection is G D a C g D 0 C 5:878 10 6 g .
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
93
1.4 1.2
E 0 /(ћwc)
1.0 0.8 0.6 0.4 0.2 0.0 0.0
0.5
1.0
1.5
2.0
β
Figure 3.2: Showing values of ground state energy E0 =.„!c / of an electron in simple harmonic oscillator potential V .x/ D 12 kx 2 with k D 10 18 , for various values of variational parameter m!c 2 2 ˇ contained in trial wavefunction ˆ0 D e ˇLx D e ˇ „ x . Minimum value of E0 =.„!c / D 1 2 2 0:5 occurs for ˇ D 0:5. Thus, the ground state eigenfunction is ˆ0 D e ˇLx D e 2 Lx D 1 m!c 2 e 2 „ x while ground state eigenvalue of energy is E0 D 0:5„!c . Using Table 3.1 in Microsoft Excel, we have evaluated the expectation value set forth in Equation (3.29) L E0 1 D< 2˛ C 4˛ 2 xi2 C xi2 > „!c 2L 2 as a value of the ground state energy. We have run Program 3.1 and executed the Microsoft Excel spreadsheet for Table 3.1 for various values of ˇ namely 0.1–2.0 and obtained values of E0 =.„!c / in each case. Table 3.2 shows the results which are plotted in Figure 3.2. We find from Figure 3.2 that minimum value 2 of E0 =.„!c / D 0:5 occurs for ˇ D 0:5. Thus, the ground state eigenfunction is ˆ0 D e ˇLx D m! 1 1 c 2 2 e 2 Lx D e 2 „ x while ground state eigenvalue of energy is E0 D 0:5„!c . We have repeated the run with Program 3.1 with k D 10 16 . Figure 3.3 shows that F .x/ and p.x/ follow each other very well and hence good results are expected. We use ˇ D 0:8, !c D 10:483 106 , L D 9:046 1010 , ˛ D ˇL D 7:237 1010 , a D 0, D 1:859 10 6 . We now generate random variables G obeying 1 p.G/ D p Exp 2
"
1 2
G
a
2 #
94
3. VARIATIONAL MONTE CARLO METHOD
1 Table 3.1: Showing tabulated values of ui , gi , Gi , 2L 2˛ C 4˛ 2 Gi2 C L2 Gi2 from which we E0 1 get „! D< 2L 2˛ C 4˛ 2 Gi2 C L2 Gi2 > : Using a D 0; D 5:878 10 6 , ˇ D 0:8; L D c 9:046 109 ; ˛ D ˇL.
i
ui
gi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
–0.955 –1.635 1.015 –0.905 0.255 2.195 0.605 –1.040 0.805 0.520 –2.295 –0.255 1.050 0.715 –0.495 –1.205 –0.795 0.880 –1.370 –0.590 –0.695 2.325 0.020 0.910 –0.935
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–5.613E–06 –9.611E–06 5.966E–06 –5.320E–06 1.499E–06 1.290E–05 3.556E–06 –6.113E–06 4.732E–06 3.057E–06 –1.349E–05 –1.499E–06 6.172E–06 4.203E–06 –2.910E–06 –7.083E–06 –4.673E–06 5.173E–06 –8.053E–06 –3.468E–06 –4.085E–06 1.367E–05 1.176E–07 5.349E–06 –5.496E–06
2
5.777E–01 1.483E–01 5.488E–01 6.003E–01 7.841E–01 –3.746E–01 7.108E–01 5.363E–01 6.420E–01 7.341E–01 –4.840E–01 7.841E–01 5.312E–01 6.754E–01 7.403E–01 4.460E–01 6.459E–01 6.112E–01 3.424E–01 7.151E–01 6.822E–01 –5.178E–01 7.999E–01 5.981E–01 5.869E–01
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
i
ui
gi
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
–0.750 0.490 –1.540 –1.465 0.980 –0.085 –0.605 0.895 –0.315 2.145 –0.905 0.210 0.285 –0.080 0.290 0.735 0.885 –0.095 2.195 0.630 0.150 1.200 –0.740 1.415 0.060
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–4.409E–06 2.880E–06 –9.052E–06 –8.611E–06 5.760E–06 –4.996E–07 –3.556E–06 5.261E–06 –1.852E–06 1.261E–05 –5.320E–06 1.234E–06 1.675E–06 –4.702E–07 1.705E–06 4.320E–06 5.202E–06 –5.584E–07 1.290E–05 3.703E–06 8.817E–07 7.054E–06 –4.350E–06 8.317E–06 3.527E–07
2
6.629E–01 7.415E–01 2.218E–01 2.768E–01 5.659E–01 7.982E–01 7.108E–01 6.047E–01 7.758E–01 –3.217E–01 6.003E–01 7.892E–01 7.802E–01 7.984E–01 7.795E–01 6.683E–01 6.091E–01 7.978E–01 –3.746E–01 7.032E–01 7.945E–01 4.489E–01 6.665E–01 3.119E–01 7.991E–01
95
96
3. VARIATIONAL MONTE CARLO METHOD
i
ui
gi
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
–0.270 –0.505 0.915 0.310 1.155 0.750 –0.020 –0.430 –0.890 0.165 –0.165 0.430 0.040 0.410 0.555 0.040 0.480 –1.320 –0.205 0.250 0.475 1.635 –1.145 –1.035 –0.685
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–1.587E–06 –2.968E–06 5.378E–06 1.822E–06 6.789E–06 4.409E–06 –1.176E–07 –2.528E–06 –5.231E–06 9.699E–07 –9.699E–07 2.528E–06 2.351E–07 2.410E–06 3.262E–06 2.351E–07 2.821E–06 –7.759E–06 –1.205E–06 1.470E–06 2.792E–06 9.611E–06 –6.730E–06 –6.084E–06 –4.026E–06
2
7.822E–01 7.378E–01 5.959E–01 7.766E–01 4.748E–01 6.629E–01 7.999E–01 7.549E–01 6.069E–01 7.934E–01 7.934E–01 7.549E–01 7.996E–01 7.590E–01 7.249E–01 7.996E–01 7.438E–01 3.752E–01 7.898E–01 7.848E–01 7.450E–01 1.483E–01 4.804E–01 5.388E–01 6.856E–01
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
i
ui
gi
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
–0.730 0.985 –0.960 0.115 0.670 –0.150 0.455 –0.560 –1.615 1.565 0.470 1.350 –0.660 –0.715 1.060 1.165 –0.040 –1.185 1.030 –0.835 –0.540 –1.460 –1.505 0.645 1.695
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–4.291E–06 5.790E–06 –5.643E–06 6.760E–07 3.938E–06 –8.817E–07 2.674E–06 –3.292E–06 –9.493E–06 9.199E–06 2.763E–06 7.935E–06 –3.879E–06 –4.203E–06 6.231E–06 6.848E–06 –2.351E–07 –6.965E–06 6.054E–06 –4.908E–06 –3.174E–06 –8.582E–06 –8.846E–06 3.791E–06 9.963E–06
6.701E–01 5.635E–01 5.753E–01 7.968E–01 6.906E–01 7.945E–01 7.495E–01 7.235E–01 1.641E–01 2.029E–01 7.461E–01 3.557E–01 6.938E–01 6.754E–01 5.261E–01 4.691E–01 7.996E–01 4.577E–01 5.414E–01 6.300E–01 7.289E–01 2.803E–01 2.478E–01 6.986E–01 9.959E–02 Sum = 57.064 E0 /(ħwc) = 0.571
2
97
98
3. VARIATIONAL MONTE CARLO METHOD
Table 3.2: Showing values of ground state energy E0 =.„!c / of an electron in simple harmonic oscillator potential V .x/ D 21 kx 2 with k D 10 18 , for various values of variational parameter ˇ m!c 2 2 contained in trial wave function ˆ0 D e ˇLx D e ˇ „ x β
E0 /(ħwc)
0.1 0.2 0.3 0.4 0.5 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
1.229 0.694 0.551 0.506 0.500 0.514 0.571 0.647 0.734 0.825 0.921 1.019 1.118
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
99
3.0
F(x) or Gaussian(x)
2.5 2.0 1.5 1.0 0.5 0.0 –4
–2
0
2
4
x
Figure 3.3: Showing F .x/ D
1 2L
2 2
2˛ C 4˛ x
as undashed curve and Gaussian p.x/ D
p1 Exp 2
C h
L 2 x 2
q 2˛
1 2
x
i a 2
e
2˛x 2
of Equation (3.33)
of Equation (3.31) as dashed
curve obtained using Program 3.1. For chosen value of spring constant k D 10 16 that corc D 9:046 1010 , ˇ D 0:8, ˛ D ˇL D 7:237 1010 , responds to !c D 10:483 MHz, L D m! „ a D 0, D 12 ˛ 1=2 D 1:859 10 6 . (Here x is in unit of 10 6 and F .x/ and p.x/ are in unit of 10 5 .) with a D 0 and D 1:859 10 obeying
6
using the tabulated values of random variable g of Table 1.4
1 g a 2 1 p.g/ D p Exp 2 2 for a D 0 and D 1. The connection is G D a C g D 0 C 1:859 10 6 g . Using Table 3.3 in Microsoft Excel, we have evaluated the expectation value set forth in Equation (3.29) L E0 1 2˛ C 4˛ 2 xi2 C xi2 > D< „!c 2L 2 as a value of the ground state energy. We have run Program 3.1 and executed the Microsoft Excel spreadsheet for Table 3.3 for various values of ˇ namely 0.1–2.0 and obtained values of E0 =.„!c / in each case. Table 3.4 shows the results which are plotted in Figure 3.4. We find from Figure 3.4 that minimum value of E0 =.„!c / D 0:5 occurs for ˇ D 0:5. Thus, the ground state eigenfunction is ˆ0 D e
ˇLx 2
De
1 2 2 Lx
De
while ground state eigenvalue of energy is E0 D 0:5„!c .
1 m!c 2 „
x2
100
3. VARIATIONAL MONTE CARLO METHOD
1 Table 3.3: Showing tabulated values of ui , gi , Gi , 2L . 2˛ C 4˛ 2 Gi2 / C L2 Gi2 from which L 2 E0 1 2 2 we get „!c D< 2L 2˛ C 4˛ Gi C 2 Gi >. Using a D 0, D 1:859 10 6 , ˇ D 0:8, k D 10 16 , L D 9:046 1010 , ˛ D ˇL D 7:237 1010 , !c D 10:483 MHz.
i
ui
gi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
–0.955 –1.635 1.015 –0.905 0.255 2.195 0.605 –1.040 0.805 0.520 –2.295 –0.255 1.050 0.715 –0.495 –1.205 –0.795 0.880 –1.370 –0.590 –0.695 2.325 0.020 0.910 –0.935
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–1.775E–06 –3.039E–06 1.887E–06 –1.682E–06 4.740E–07 4.081E–06 1.125E–06 –1.933E–06 1.496E–06 9.667E–07 –4.266E–06 –4.740E–07 1.952E–06 1.329E–06 –9.202E–07 –2.240E–06 –1.478E–06 1.636E–06 –2.547E–06 –1.097E–06 –1.292E–06 4.322E–06 3.718E–08 1.692E–06 –1.738E–06
2
5.776E–01 1.482E–01 5.488E–01 6.003E–01 7.841E–01 –3.748E–01 7.107E–01 5.363E–01 6.420E–01 7.341E–01 –4.843E–01 7.841E–01 5.312E–01 6.753E–01 7.403E–01 4.459E–01 6.459E–01 6.112E–01 3.423E–01 7.151E–01 6.822E–01 –5.181E–01 7.999E–01 5.981E–01 5.868E–01
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
i
ui
gi
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
–0.750 0.490 –1.540 –1.465 0.980 –0.085 –0.605 0.895 –0.315 2.145 –0.905 0.210 0.285 –0.080 0.290 0.735 0.885 –0.095 2.195 0.630 0.150 1.200 –0.740 1.415 0.060
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–1.394E–06 9.109E–07 –2.863E–06 –2.723E–06 1.822E–06 –1.580E–07 –1.125E–06 1.664E–06 –5.856E–07 3.988E–06 –1.682E–06 3.904E–07 5.298E–07 –1.487E–07 5.391E–07 1.366E–06 1.645E–06 –1.766E–07 4.081E–06 1.171E–06 2.789E–07 2.231E–06 –1.376E–06 2.630E–06 1.115E–07
2
6.628E–01 7.415E–01 2.217E–01 2.767E–01 5.658E–01 7.982E–01 7.107E–01 6.047E–01 7.758E–01 –3.219E–01 6.003E–01 7.892E–01 7.802E–01 7.984E–01 7.795E–01 6.683E–01 6.090E–01 7.978E–01 –3.748E–01 7.032E–01 7.945E–01 4.489E–01 6.665E–01 3.118E–01 7.991E–01
101
102
3. VARIATIONAL MONTE CARLO METHOD
i
ui
gi
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
–0.270 –0.505 0.915 0.310 1.155 0.750 –0.020 –0.430 –0.890 0.165 –0.165 0.430 0.040 0.410 0.555 0.040 0.480 –1.320 –0.205 0.250 0.475 1.635 –1.145 –1.035 –0.685
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–5.019E–07 –9.388E–07 1.701E–06 5.763E–07 2.147E–06 1.394E–06 –3.718E–08 –7.994E–07 –1.655E–06 3.067E–07 –3.067E–07 7.994E–07 7.436E–08 7.622E–07 1.032E–06 7.436E–08 8.923E–07 –2.454E–06 –3.811E–07 4.648E–07 8.830E–07 3.039E–06 –2.129E–06 –1.924E–06 –1.273E–06
2
7.822E–01 7.378E–01 5.958E–01 7.766E–01 4.747E–01 6.628E–01 7.999E–01 7.549E–01 6.069E–01 7.934E–01 7.934E–01 7.549E–01 7.996E–01 7.590E–01 7.249E–01 7.996E–01 7.438E–01 3.751E–01 7.898E–01 7.848E–01 7.450E–01 1.482E–01 4.803E–01 5.388E–01 6.856E–01
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
i
ui
gi
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
–0.730 0.985 –0.960 0.115 0.670 –0.150 0.455 –0.560 –1.615 1.565 0.470 1.350 –0.660 –0.715 1.060 1.165 –0.040 –1.185 1.030 –0.835 –0.540 –1.460 –1.505 0.645 1.695
1 (–2α + 4α2G 2) + – LG 2 Gi = a + σ g i – — i i 2L
–1.357E–06 1.831E–06 –1.785E–06 2.138E–07 1.246E–06 –2.789E–07 8.458E–07 –1.041E–06 –3.002E–06 2.909E–06 8.737E–07 2.510E–06 –1.227E–06 –1.329E–06 1.971E–06 2.166E–06 –7.436E–08 –2.203E–06 1.915E–06 –1.552E–06 –1.004E–06 –2.714E–06 –2.798E–06 1.199E–06 3.151E–06
6.701E–01 5.634E–01 5.753E–01 7.968E–01 6.905E–01 7.945E–01 7.495E–01 7.235E–01 1.640E–01 2.028E–01 7.461E–01 3.556E–01 6.938E–01 6.753E–01 5.260E–01 4.691E–01 7.996E–01 4.576E–01 5.413E–01 6.300E–01 7.289E–01 2.802E–01 2.477E–01 6.986E–01 9.943E–02 Sum = 57.058 E0 /(ħwc) = 0.571
2
103
104
3. VARIATIONAL MONTE CARLO METHOD
Table 3.4: Showing values of ground state energy E0 =.„!c / of an electron in simple harmonic oscillator potential V .x/ D 21 kx 2 with k D 10 16 , for various values of variational parameter ˇ m!c 2 2 contained in trial wavefunction ˆ0 D e ˇLx D e ˇ „ x β
E0 /(ħwc)
0.1 0.2 0.3 0.4 0.5 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
1.229 0.694 0.551 0.506 0.500 0.514 0.571 0.647 0.733 0.825 0.921 1.019 1.117
3.3. GROUND STATE ENERGY OF A SIMPLE HARMONIC OSCILLATOR
105
1.4 1.2
E 0 /(ћwc)
1.0 0.8 0.6 0.4 0.2 0.0 0.0
0.5
1.0
1.5
2.0
β
Figure 3.4: Showing values of ground state energy E0 =.„!c / of an electron in simple harmonic oscillator potential V .x/ D 12 kx 2 with k D 10 16 , for various values of variational parameter m!c 2 2 ˇ contained in trial wavefunction ˆ0 D e ˇLx D e ˇ „ x . Minimum value of E0 =.„!c / D 1 2 2 0:5 occurs for ˇ D 0:5. Thus, the ground state eigenfunction is ˆ0 D e ˇLx D e 2 Lx D 1 m!c 2 e 2 „ x while ground state eigenvalue of energy is E0 D 0:5„!c .
107
CHAPTER
4
Variational Monte Carlo Method Applied to the Ground State of a Hydrogen Atom 4.1
THE VARIATIONAL METHOD OF QUANTUM MECHANICS APPLIED TO THE GROUND STATE OF ANY QUANTUM MECHANICAL SYSTEM (AGAIN)
Let ‰0 ; ‰1 ; ‰2 ; ‰3 ; : : : ; ‰N be exact, unknown, orthonormal eigenfunctions of known Hamiltonian H . Let E0 < E1 < E2 < E3 < : : : < EN be exact, unknown eigenvalues of energy, respectively. That is, we have eigenvalue equation H ‰n D En ‰n
(4.1)
which we cannot solve. Suppose we wish to estimate E0 and we wish to know approximate form of ‰0 . Let us choose by guess a suitable function ˆ0 that is expected to resemble unknown ‰0 and write N X ˆ0 D Cn.0/ ‰n (4.2) nD0
and let us evaluate the quantity Eˆ0 given by R ˆ0 Hˆ0 d .ˆ0 ; Hˆ0 / Eˆ0 D (4.3) D R .ˆ0 ; ˆ0 / ˆ0 ˆ0 d P P P P .0/ .0/ .0/ .0/ C ‰ ; C H ‰ C ‰ ; H C ‰ m n m n m n m n mD0 nD0 mD0 nD0 D P D P P P .0/ .0/ .0/ .0/ mD0 Cm ‰m ; nD0 Cn ‰n mD0 Cm ‰m ; nD0 Cn ‰n P P .0/ .0/ mD0 Cm ‰m ; nD0 Cn En ‰n D P P .0/ .0/ C ‰ ; C ‰ m n mD0 m nD0 n
108
4. VARIATIONAL MONTE CARLO METHOD
using Equation (4.1) D
P
mD0
P
P
mD0
nD0
P
Cm.0/ Cn.0/ En .‰m ; ‰n /
nD0
Cm.0/ Cn.0/ .‰m ; ‰n /
D
D
P
mD0
P
P
nD0
P
Cm.0/ Cn.0/ En ımn
.0/ .0/ nD0 Cm Cn ımn ˇ ˇ P ˇ .0/ ˇ2 C ˇ n ˇ En nD0 mD0
ˇ ˇ : ˇ .0/ ˇ2 C nD0 ˇ n ˇ
P
Thus,
Eˆ0
ˇ ˇ ˇ .0/ ˇ2 nD0 ˇCn ˇ En E0 D E0 ˇ ˇ P ˇ .0/ ˇ2 nD0 ˇCn ˇ ˇ ˇ P ˇ .0/ ˇ2 C E0 / ˇ n ˇ .En nD0 D : ˇ ˇ P ˇ .0/ ˇ2 C nD0 ˇ n ˇ P
(4.4)
ˇ2 ˇ ˇ ˇ In Equation (4.4), En E0 . ) En E0 0; moreover, ˇCn.0/ ˇ 0. Thus, Equation (4.4) shows that Eˆ0 E0 0 or, Eˆ0 E0 . We find that for arbitrary ˆ0 , calculated value of Eˆ0 E0 , i.e., Eˆ0 is larger than or equal to ground state energy E0 . Eˆ0 gives upper bound of ground state energy E0 . If chosen ˆ0 is different from actual unknown ‰0 , calculated value of Eˆ0 calculated using Equation (4.3) will be larger than E0 . If chosen ˆ0 happens to be same as unknown ‰0 , value of Eˆ0 calculated using Equation (4.3) becomes equal to E0 . Thus, we can choose arbitrary ˆ0 and calculate Eˆ0 using Equation (4.3) and get upper bound of E0 . Usually we choose a suitable ˆ0 known as trail function containing one or more adjustable .0/ parameters ˛i.0/ ’s, e.g., ˆ0 D e ˛1 x where ˛1.0/ is an adjustable parameter. Then we use this expression of ˆ0 in Equation (4.3) and calculated expression of Eˆ0 will contain the parameters @E 0 .0/ ˛i.0/ ’s. We then stipulate ˆ separately. We thus get values of ˛i.0/ ’s for which .0/ D 0 for each ˛i @˛i
Eˆ0 is minimum. We can put these values of ˛i.0/ ’s in the expression of Eˆ0 . We then get the lowest value of Eˆ0 for the chosen ˆ0 . This upper bound to E0 will be close to actual unknown value of E0 if trail function ˆ0 has a form closely resembling that of actual unknown ‰0 . The entire process is repeated for several different functions as ˆ0 to see which function leads to much lower value of Eˆ0 . If we are happy that a calculated value of Eˆ0 is low enough and that it is likely to be close to actual unknown value of E0 , we can take E0 Eˆ0 and ‰0 ˆ0 within some approximation.
4.2. THE VARIATIONAL METHOD OF QUANTUM MECHANICS: GROUND STATE
4.2
109
THE VARIATIONAL METHOD OF QUANTUM MECHANICS APPLIED TO THE GROUND STATE OF A HYDROGEN ATOM 2
2
„ e 1 We have a Hamiltonian operator H D 2m r 2 4" of a hydrogen atom. More explicitly, 0 r we have in a spherical polar coordinate system the Hamiltonian operator as „2 1 @ 1 @ @ 1 @2 e2 1 2 @ H D r C Sin C ; 2m r 2 @r @r r 2 Sin @ @ 4"0 r r 2 Sin2 @ 2
where m D 9:095 10 31 kg is a reduced mass of a proton-electron two-body system. Let us choose ˆ0 D e ˛r D e r=a0 by guess as an approximate form of ground state eigenfunction ˆ0 and let us evaluate the quantity E0 D
.ˆ0 ; Hˆ0 / : .ˆ0 ; ˆ0 /
(4.5)
Here, a0 D 0:53 Å is the so-called Bohr radius. Now, .ˆ0 ; ˆ0 / D .e ˛r ; e ˛r / Z 2 Z Z D D0
D 4
Z
D0
/
rD0
e
/
e
2˛r 2
rD0
.2˛/r 3 1
r
r dr Sindd D 4
dr D 4.2˛/
.ˆ0 ; ˆ0 / D
3
2Š D
Z
/
e
2˛r 2
r dr
rD0
: ˛3
: ˛3
(4.6)
Now, Hˆ0 D
„2 1 @ 1 @ @ˆ0 1 @ 2 ˆ0 2 @ˆ0 r C Sin C 2m r 2 @r @r r 2 Sin @ @ r 2 Sin2 @ 2
or Hˆ0 D
„2 1 @ 2 @ˆ0 r C0C0 2m r 2 @r @r
Hˆ0 D
„2 1 @ 2 @ˆ0 r 2m r 2 @r @r
Hˆ0 D
˛r „2 1 @ 2 @e r 2m r 2 @r @r
e2 1 ˆ0 4"0 r
or e2 1 ˆ0 4"0 r
or e2 1 e 4"0 r
˛r
e2 1 ˆ0 4"0 r
110
4. VARIATIONAL MONTE CARLO METHOD
or „2 ˛2 2m
Hˆ0 D
2 ˛ e r
˛r
e2 1 e 4"0 r
˛r
(4.7)
:
As such, E0 D
.ˆ0 ; Hˆ0 / .ˆ0 ; ˆ0 /
E0 D
.ˆ0 ; Hˆ0 / ; =˛ 3
gives
or 4
R/
rD0
E0 D
„2 ˛2 2m
2 ˛ r =˛ 3
e2 1 e 4"0 r
2˛r 2
r dr
or E0 D
Z
/
4˛
3
rD0
„2 ˛2 2m
2 ˛ e r
2˛r
e2 1 e 4"0 r
2˛r
r 2 dr:
(4.8)
This integral is evaluated in the next section using the Monte Carlo method.
4.3
GROUND STATE ENERGY OF A HYDROGEN ATOM USING THE VARIATIONAL MONTE CARLO METHOD
We first gather the exact results from the Quantum Mechanics books. The ground state eigenfunction is ˆ0 D e ˛r D e r=a0 with a0 called Bohr radius given by 0.53 Å and eigenvalue of energy equal to 13:6 eV. As to the Monte Carlo method, we take up Equation (4.8): Z / „2 2 e 2 1 2˛r 2 2 2˛r 3 ˛ ˛ e e r dr; E0 D 4˛ 2m r 4"0 r rD0 and rewrite it as E0 D
where F .r/ D 4˛
3
„2 ˛2 2m
Z
/
(4.9)
F .r/dr;
rD0
2 ˛ e r
2˛r
e2 1 e 4"0 r
2˛r
r 2:
(4.10)
4.3. GROUND STATE ENERGY OF HYDROGEN ATOM
111
2.0 × 1010
F(r) or p(r)
1.5 × 1010
1.0 × 1010
5.0 × 109
0 0
1
2
r/a 0
3
4
5
Figure 4.1:h Smooth curve shows 0:55 1018 F .r/ and dashed curve shows Gaussian p.r/ D i 1 r a 2 p1 Exp for a D 1:0a0 and D 0:43a0 , a0 D 0:5 Å. We find that F .r/ and Gaus2 2 sian p.r/ are nearly proportional to each other and hence Gaussian p.r/ is an ideal choice for the Monte Carlo calculation. We now re-write Equation (4.9) as E0 D
Z
/
rD0
F .r/ p.r/dr; p.r/
(4.11)
where p.r/ is a probability density function to be taken such that it resembles F .r/. Thus, E0 is .r/ , i.e., given by average or expectation value of Fp.r/ E0 D
: p.r/
(4.12)
Thus, what we need to do is to see the functional form of F .r/ and get a probability density .r/ function p.r/ that looks like F .r/ and calculate average value of Fp.r/ for various values of a0 in .r/ the range 0.3–1 Å. We need to find out the lowest value of < Fp.r/ > which is expected to yield about 13:6 eV. Using Program 4.1 in Mathematica 6.0, for a0 D 0:5 Å, we have plotted 0:55 1018 F .r/ and Gaussian 1 1 r a 2 p.r/ D p Exp 2 2
for a D 1:0a0 and D 0:43a0 . We find that F .r/ and Gaussian p.r/ are nearly proportional to each other and hence Gaussian p.r/ is an ideal choice for the Monte Carlo calculation.
112
4. VARIATIONAL MONTE CARLO METHOD
Program 4.1
a0=0.5*10^-10; alpha=1/a0; m=1837*(9.1*(10^-31))/1838; hcut=(6.626*(10^-34))/(2*3.1416); ce=1.6*(10^-19); ep0=8.85*(10^-12); F=Plot[(-0.55*10^18)*(4*(alpha^3)*(-(hcut^2)/ (2*m))*(alpha^2-2*alpha/(r*a0))* Exp[-2*alpha*(r*a0)]-(4*(alpha^3))*((ce^2)/(4*3.1416*ep0*(r*a0)))* Exp[-2*alpha*(r*a0)])*(r*a0)^2,{r,0,5},PlotStyle->{Black},Frame->True, FrameLabel->{"r/a0","F(r) or p(r)"},PlotRange->{0,2*10^10}] sig=0.43*a0; a=1.0*a0; p=Plot[(1/(sig*Sqrt[2*Pi]))*Exp[-0.5*((r*a0-a)/sig)^2],{r,0,5}, PlotStyle->{Dashed,Black},Frame->True, FrameLabel->{"r/a0","F(r) or p(r)"}, PlotRange->{0,2*10^10}] Show[F,p]
For values of a0 in the range 0.3–1 Å, we have run the Program 4.1 and find that F .r/ and p.r/ match well for different pairs of values of a and tabulated in Table 4.1. Using Table 4.2 in Microsoft Excel, we have evaluated the expectation value set forth in .r/ Equation (4.12): E0 D< Fp.r/ > as a value of the ground state energy. Here, F .r/ D 4˛ 3
„2 ˛2 2m
2 ˛ e r
and 1 p.r/ D p Exp 2
2˛r
e2 1 e 4"0 r
2˛r
r2
1 r a 2 : 2
We have run Program 4.1 and executed the Microsoft Excel spreadsheet for Table 4.2 for various values of a0 namely 0.3–1.0 Å and obtained values of E0 in each case. Table 4.3 shows the results which are plotted in Figure 4.2. We find from Figure 4.2 that E0 reaches a minimum for a0 around 0.5 Å as expected. The minimum value is about 11:34 eV for a0 D
4.3. GROUND STATE ENERGY OF HYDROGEN ATOM
113
Table 4.1: Pairs of values of a and for which F .r/ and p.r/ match with each other within a constant multiple, ascertained using Program 4.1 a0 in Å 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
a 1.6a0 1.3a0 1.0a0 0.9a0 0.8a0 0.7a0 0.7a0 0.6a0
0.50a0 0.50a0 0.43a0 0.40a0 0.35a0 0.35a0 0.30a0 0.25a0
0.6
0.7
σ
–6 –7
E 0 (eV)
–8 –9
–10 –11 –12 0.3
0.4
0.5
0.8
0.9
1.0
a 0 (Å)
Figure 4.2: Showing values of ground state energy E0 of a hydrogen atom for various values of Bohr radius a0 contained in trial wavefunction ˆ0 D e r=a0 . Minimum value of E0 D 11:34 eV occurs around a0 D 0:5 Å. 0:5 Å. The deviation from the calculations.
13:6 eV is not surprising given only 100 random numbers used in
114
4. VARIATIONAL MONTE CARLO METHOD
2 h i „ Table 4.2: Showing tabulated values of ui , gi , Gi , F .Gi / D 4˛ 3 ˛ 2 G2i ˛ e 2˛Gi 2m 2 Gi a e2 1 1 1 2 2˛Gi Gi ; and p.Gi / D p Exp ; F .Gi /=p.Gi / from which we e 4"0 Gi 2 2
get the average value of E0 D< a D 1:0a0 , D 0:43a0 .
F p
> as a value of the ground state energy. Using a0 D 0:5 Å,
i
ui
gi
Gi
Fi
pi
Fi /pi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0.169 0.050 0.844 0.182 0.599 0.985 0.726 0.148 0.788 0.698 0.010 0.397 0.852 0.761 0.309 0.113 0.212 0.809 0.084 0.276 0.243 0.989 0.508 0.817 0.174
–0.955 –1.635 1.015 –0.905 0.255 2.195 0.605 –1.040 0.805 0.520 –2.295 –0.255 1.050 0.715 –0.495 –1.205 –0.795 0.880 –1.370 –0.590 –0.695 2.325 0.020 0.910 –0.935
2.95E–11 1.48E–11 7.18E–11 3.05E–11 5.55E–11 9.72E–11 6.30E–11 2.76E–11 6.73E–11 6.12E–11 6.58E–13 4.45E–11 7.26E–11 6.54E–11 3.94E–11 2.41E–11 3.29E–11 6.89E–11 2.05E–11 3.73E–11 3.51E–11 1.00E–10 5.04E–11 6.96E–11 2.99E–11
–1.67E–08 –5.76E–09 –2.10E–08 –1.74E–08 –2.34E–08 –1.42E–08 –2.27E–08 –1.56E–08 –2.19E–08 –2.29E–08 2.61E–10 –2.27E–08 –2.08E–08 –2.23E–08 –2.14E–08 –1.31E–08 –1.87E–08 –2.16E–08 –1.04E–08 –2.06E–08 –1.97E–08 –1.35E–08 –2.34E–08 –2.15E–08 –1.70E–08
1.18E+10 4.88E+09 1.11E+10 1.23E+10 1.80E+10 1.67E+09 1.55E+10 1.08E+10 1.34E+10 1.62E+10 1.33E+09 1.80E+10 1.07E+10 1.44E+10 1.64E+10 8.98E+09 1.35E+10 1.26E+10 7.26E+09 1.56E+10 1.46E+10 1.24E+09 1.86E+10 1.23E+10 1.20E+10
–1.42E–18 –1.18E–18 –1.89E–18 –1.41E–18 –1.30E–18 –8.53E–18 –1.47E–18 –1.44E–18 –1.63E–18 –1.41E–18 1.96E–19 –1.26E–18 –1.94E–18 –1.55E–18 –1.30E–18 –1.46E–18 –1.38E–18 –1.71E–18 –1.43E–18 –1.32E–18 –1.35E–18 –1.09E–17 –1.26E–18 –1.75E–18 –1.42E–18
4.3. GROUND STATE ENERGY OF HYDROGEN ATOM
i
ui
gi
Gi
Fi
pi
Fi /pi
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
0.225 0.687 0.060 0.070 0.835 0.466 0.271 0.813 0.376 0.983 0.181 0.583 0.612 0.468 0.614 0.768 0.811 0.461 0.985 0.735 0.559 0.884 0.229 0.920 0.524
–0.750 0.490 –1.540 –1.465 0.980 –0.085 –0.605 0.895 –0.315 2.145 –0.905 0.210 0.285 –0.080 0.290 0.735 0.885 –0.095 2.195 0.630 0.150 1.200 –0.740 1.415 0.060
3.39E–11 6.05E–11 1.69E–11 1.85E–11 7.11E–11 4.82E–11 3.70E–11 6.92E–11 4.32E–11 9.61E–11 3.05E–11 5.45E–11 5.61E–11 4.83E–11 5.62E–11 6.58E–11 6.90E–11 4.80E–11 9.72E–11 6.35E–11 5.32E–11 7.58E–11 3.41E–11 8.04E–11 5.13E–11
–1.91E–08 –2.30E–08 –7.41E–09 –8.72E–09 –2.11E–08 –2.32E–08 –2.05E–08 –2.15E–08 –2.24E–08 –1.45E–08 –1.74E–08 –2.34E–08 –2.34E–08 –2.32E–08 –2.34E–08 –2.22E–08 –2.16E–08 –2.32E–08 –1.42E–08 –2.26E–08 –2.35E–08 –2.00E–08 –1.93E–08 –1.88E–08 –2.34E–08
1.40E+10 1.65E+10 5.67E+09 6.34E+09 1.15E+10 1.85E+10 1.55E+10 1.24E+10 1.77E+10 1.86E+09 1.23E+10 1.82E+10 1.78E+10 1.85E+10 1.78E+10 1.42E+10 1.25E+10 1.85E+10 1.67E+09 1.52E+10 1.83E+10 9.03E+09 1.41E+10 6.82E+09 1.85E+10
–1.37E–18 –1.40E–18 –1.31E–18 –1.38E–18 –1.84E–18 –1.26E–18 –1.33E–18 –1.73E–18 –1.27E–18 –7.81E–18 –1.41E–18 –1.29E–18 –1.31E–18 –1.26E–18 –1.31E–18 –1.57E–18 –1.72E–18 –1.26E–18 –8.53E–18 –1.48E–18 –1.28E–18 –2.21E–18 –1.36E–18 –2.76E–18 –1.27E–18
115
116
4. VARIATIONAL MONTE CARLO METHOD
i
ui
gi
Gi
Fi
pi
Fi /pi
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
0.393 0.306 0.819 0.620 0.875 0.773 0.492 0.332 0.185 0.565 0.434 0.665 0.516 0.659 0.709 0.515 0.683 0.092 0.417 0.598 0.682 0.948 0.125 0.149 0.246
–0.270 –0.505 0.915 0.310 1.155 0.750 –0.020 –0.430 –0.890 0.165 –0.165 0.430 0.040 0.410 0.555 0.040 0.480 –1.320 –0.205 0.250 0.475 1.635 –1.145 –1.035 –0.685
4.42E–11 3.91E–11 6.97E–11 5.67E–11 7.48E–11 6.61E–11 4.96E–11 4.08E–11 3.09E–11 5.35E–11 4.65E–11 5.92E–11 5.09E–11 5.88E–11 6.19E–11 5.09E–11 6.03E–11 2.16E–11 4.56E–11 5.54E–11 6.02E–11 8.52E–11 2.54E–11 2.77E–11 3.53E–11
–2.26E–08 –2.13E–08 –2.14E–08 –2.33E–08 –2.02E–08 –2.21E–08 –2.33E–08 –2.18E–08 –1.76E–08 –2.35E–08 –2.30E–08 –2.31E–08 –2.34E–08 –2.32E–08 –2.28E–08 –2.34E–08 –2.30E–08 –1.12E–08 –2.29E–08 –2.34E–08 –2.30E–08 –1.75E–08 –1.40E–08 –1.57E–08 –1.98E–08
1.79E+10 1.63E+10 1.22E+10 1.77E+10 9.52E+09 1.40E+10 1.86E+10 1.69E+10 1.25E+10 1.83E+10 1.83E+10 1.69E+10 1.85E+10 1.71E+10 1.59E+10 1.85E+10 1.65E+10 7.76E+09 1.82E+10 1.80E+10 1.66E+10 4.88E+09 9.63E+09 1.09E+10 1.47E+10
–1.26E–18 –1.30E–18 –1.76E–18 –1.32E–18 –2.13E–18 –1.58E–18 –1.26E–18 –1.29E–18 –1.41E–18 –1.28E–18 –1.26E–18 –1.37E–18 –1.26E–18 –1.36E–18 –1.43E–18 –1.26E–18 –1.39E–18 –1.45E–18 –1.26E–18 –1.30E–18 –1.39E–18 –3.59E–18 –1.46E–18 –1.44E–18 –1.35E–18
4.3. GROUND STATE ENERGY OF HYDROGEN ATOM
i
ui
gi
Gi
Fi
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
0.231 0.836 0.167 0.545 0.748 0.440 0.674 0.287 0.052 0.940 0.679 0.910 0.254 0.236 0.854 0.877 0.483 0.117 0.847 0.201 0.294 0.071 0.065 0.740 0.954
–0.730 0.985 –0.960 0.115 0.670 –0.150 0.455 –0.560 –1.615 1.565 0.470 1.350 –0.660 –0.715 1.060 1.165 –0.040 –1.185 1.030 –0.835 –0.540 –1.460 –1.505 0.645 1.695
3.43E–11 7.12E–11 2.94E–11 5.25E–11 6.44E–11 4.68E–11 5.98E–11 3.80E–11 1.53E–11 8.36E–11 6.01E–11 7.90E–11 3.58E–11 3.46E–11 7.28E–11 7.50E–11 4.91E–11 2.45E–11 7.21E–11 3.20E–11 3.84E–11 1.86E–11 1.76E–11 6.39E–11 8.64E–11
–1.94E–08 –2.11E–08 –1.67E–08 –2.35E–08 –2.24E–08 –2.31E–08 –2.31E–08 –2.09E–08 –6.10E–09 –1.79E–08 –2.30E–08 –1.92E–08 –2.00E–08 –1.95E–08 –2.07E–08 –2.02E–08 –2.33E–08 –1.34E–08 –2.09E–08 –1.82E–08 –2.10E–08 –8.81E–09 –8.02E–09 –2.25E–08 –1.72E–08
pi
Fi /pi
1.42E+10 –1.36E–18 1.14E+10 –1.85E–18 1.17E+10 –1.42E–18 1.84E+10 –1.27E–18 1.48E+10 –1.51E–18 1.83E+10 –1.26E–18 1.67E+10 –1.38E–18 1.59E+10 –1.32E–18 5.04E+09 –1.21E–18 5.45E+09 –3.29E–18 1.66E+10 –1.39E–18 7.46E+09 –2.57E–18 1.49E+10 –1.34E–18 1.44E+10 –1.36E–18 1.06E+10 –1.96E–18 9.41E+09 –2.14E–18 1.85E+10 –1.26E–18 9.19E+09 –1.46E–18 1.09E+10 –1.91E–18 1.31E+10 –1.39E–18 1.60E+10 –1.31E–18 6.39E+09 –1.38E–18 5.98E+09 –1.34E–18 1.51E+10 –1.49E–18 4.41E+09 –3.89E–18 Sum = –1.81E–16 E0 = –11.33 eV
117
118
4. VARIATIONAL MONTE CARLO METHOD
Table 4.3: Showing values of ground state energy E0 of a hydrogen atom for various values of Bohr radius a0 contained in trial wavefunction ˆ0 D e r=a0 a0 (Å) 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
E0 (eV) –9.83 –11.21 –11.34 –11.03 –9.98 –9.16 –8.34 –6.98
119
CHAPTER
5
Concluding Remarks 1. This book is intended for undergraduate students of Mathematics, Statistics, and Physics who know nothing about the Monte Carlo method but wish to know how it works. 2. All treatments have been done as much manually as is practicable. 3. The treatments are deliberately manual to let the readers get the real feel of how the Monte Carlo method works. 4. Definite integrals of a total of five functions F .x/, namely Sin.x/; Cos.x/; e x , loge .x/, 1 , have been evaluated using constant, linear, Gaussian, and exponential probability 1Cx 2 density functions p.x/. 5. It is shown that results agree with known exact values better if p.x/ is proportional to F .x/. 6. Deviation from the proportionality results in worse agreement. 7. Necessary background materials are covered in Chapter 1 while the integrals are evaluated in Chapter 2. 8. Two separate chapters have been dedicated to the variational Monte Carlo method applied to the ground state of a simple harmonic oscillator and of a hydrogen atom with remarkable success given only 100 random numbers used. 9. The book is a good read, and is intended to make the readers adept at using the method.
121
Bibliography [1] IIya M. Sobol, A Primer for the Monte Carlo Method, CRC Press, 1994. [2] IIya M. Sobol, The Monte Carlo Method, The University of Chicago Press, 1974. [3] Yu. A. Shreider, Ed., The Monte Carlo Method: The Method of Statistical Trials, Pergamon Press, 1966.
123
Author’s Biography SUJAUL CHOWDHURY Sujaul Chowdhury is a Professor in the Department of Physics at the Shahjalal University of Science and Technology (SUST), Sylhet, Bangladesh (www.sust.edu). He obtained a B.Sc. (Honours) in Physics in 1994 and an M.Sc. in Physics in 1996 from SUST. He obtained a Ph.D. in Physics from The University of Glasgow, UK in 2001. He was a Humboldt Research Fellow for one year at The Max Planck Institute, Stuttgart, Germany.