Project
Project
METHODS
DISSERTATION SUBMITTED TO
ANAND SAI P
Reg.No. 12200005
ABEL JOSHY
Reg.No. 12200013
Ms. DEVI N
Department of Mathematics
DEPARTMENT OF MATHEMATICS
ST. BERCHMANS COLLEGE
CHANGANASSERY
2022-2025
DECLARATION
We, Anand Sai P (Reg.No. 12200005) and Abel Joshy (Reg.No. 12200013) do
hereby declare that the dissertation entitled “An Exploration of Monte Carlo
ics, St. Berchmans College, Changanassery, and that this dissertation or any part
thereof has not previously formed the basis for the award of any degree, diploma,
This is to certify that Mr. Anand Sai P and Mr. Abel Joshy, has undergone
the B.Sc. Degree Course at St. Berchmans College, Changanassery, during the
period 2022-2025, and has undertaken the dissertation under the guidance of Ms.
This is to certify that the dissertation entitled “An Exploration of Monte Carlo
Methods” submitted by Mr. Anand Sai P and Mr. Abel Joshy to the Controller
have not been submitted to any other Institute or University for the award of any
degree or diploma.
We take this opportunity to express our profound gratitude and deep regards to
of this project. The blessing, help and guidance given by her time to time shall carry
us a long way in the journey of our life on which we are about to embark.
We would like to express our gratitude towards our family, our faculty and
our friends for their kind cooperation and encouragement which help us in the
Anand Sai P
Abel Joshy
Contents
Introduction 2
1 Preliminary 4
1.1 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Probability Density Function . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Mathematical Expectation . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Exponential Distribution . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Gamma Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Conclusion 37
References 39
1
Introduction: Unveiling
Methods
offer a unique approach to tackling challenges that defy analytical solutions. This
assignment delves into the fascinating world of Monte Carlo methods, exploring their
methods lies in the ability to effectively generate random samples from desired dis-
”Importance Sampling.”
2
3
pling Monte Carlo Methods.” Here, we explore how randomness can be harnessed
Problems” and simulating crucial ”Transport Properties,” with detailed case study
on ”Neutron Transport”. These examples will showcase the power of Monte Carlo
methods by exploring their applications ”at the Periphery of Physics and Beyond.”
wide-ranging impact of Monte Carlo approaches across scientific and economic do-
for the power and elegance of Monte Carlo methods in unraveling the complexities
of our world.
Chapter 1
Preliminary
1.1 Sampling
Population is the totality or aggregate of units defined according to the aim of sta-
tistical investigation.
of X if
Z x+dx
P [x ≤ X ≤ x + dx] = f (x)dx
x
Properties of p.d.f
4
5
1. f (x) ≥ 0
R
2. RX
f (x)dx = 1
Let X be a discrete Random Variable and let its values with non-zero probabilities
be x1 , x2 , x3 , .... Let P (x) be its probability density function. ie, P (x) = P (X = x).
is given by
X
E(X) = xP (x)
x
Example
Suppose that probability that sets containing 1,2,3,4 and 5 persons pay a visit to an
art gallery are 0.2,0.5,0.2,0.07,0.3 respectively. Then what is the expected number
Expectation,
X
E(X) = xP (x)
x
= 2.23
Let X be a continuous Random Variable with p.d.f f (x). Then the mathematical
R∞
expectation of X is defined as E(X) = ∞ x.f (x)dx, provided the integral on the
Example
Z ∞
E(X) = x.f (x)dx
Z∞1
= x.30x4 (1 − x)dx
0
Z 1
= 30 x5 (1 − x)dx
Z0 1
= 30 (x5 − x6 )dx
0
6
x x7
= 30[ − ]
6 7
5
=
7
Let X be a Random Variable with p.d.f f (x) and ϕ(x) any measurable function of
3
2
X x
E(X + 2) = (x + 2)2
x=1
6
1 2 3 58
= (1 + 2)2 × + (2 + 2)2 × + (3 + 2)2 × =
6 6 6 3
7
Properties of Expectation
1. If X is any Random Variable, a and b any 2 constants and ϕ(x) any measurable
function of X, then
E(a.ϕ(x) + b) = aE(ϕ(x)) + b
= 0, elsewhere
Mean
µ′1 = E(X)
Z
= x.f (x)dx
Zx ∞
= xλe−λx dx
0
Z ∞
=λ x2−1 e−λx dx
0
1
=
λ
8
Zx ∞
= x2 λe−λx dx
0
Z ∞
=λ x3−1 e−λx dx
0
2
= 2
λ
2 1
V (X) = 2 − ( )2
λ λ
2 1
= 2− 2
λ λ
1
= 2
λ
= 0, elsewhere
µ′1 = E(X)
Z
= x.f (x)dx
Zx ∞
1
= x e−x xp−1
0 Γp
Z ∞
1
= e−x xp+1−1
Γp 0
1 Γp+1
=
Γp 1p+1
(p + 1 − 1)!
= =p
(p − 1)!
9
Zx ∞
1
= x2 e−x xp−1 dx
0 Γp
Z ∞
1
= e−x xp+2−1 dx
Γp 0
1 Γp+2
= ×
Γp p + 2
(p + 2 − 1)!
=
(p − 1)!
= p(p + 1)
V (X) = p(p + 1) − p2 = p2 + p − p2 = p
Z
Ep [g(X)] = g(x)p(x)dx.
10
11
Z
p(x)
Ep [g(X)] = g(x)
q(x)dx,
q(x)
we can approximate the expectation using Monte Carlo sampling from q(x):
N
1 X
Ep [g(X)] ≈ g(Xi )wi ,
N i=1
where:
• wi = p(Xi )
q(Xi )
are called importance weights.
Problem Statement
Z ∞
2
I= e−x x2 dx
0
Solution
2
f (x) x2 e−x 2 2
w(x) = = −x = x2 e−x +x = x2 ex−x .
q(x) e
12
N
1 X f (xi )
I≈
N i=1 q(xi )
Expanding f (x) and q(x):
N 2
1 X x2i e−xi
I≈
N i=1 e−xi
which simplifies to:
N
1 X 2 −(x2i −xi )
I≈ xe
N i=1 i
The estimated value of the integral using Monte Carlo Importance Sampling
I ≈ 0.444
√
π
I= = 0.443.
4
Chapter 3
methods
3.1 Introduction
Modern Monte Carlo methods have their roots in the 1940s when Fermi, Ulam,
von Neumann, Metropolis and others began considering the use of random numbers
1989); this set of biographical articles about S. Ulam provides fascinating insight
into the early development of the Monte Carlo method, even before the advent of
the modern computer). Very simple Monte Carlo methods were devised to provide
Carlo techniques retain their importance because of the dramatic increase in acces-
sible computing power which has taken place during the last two decades. In the
remainder of this chapter we shall consider the application of simple Monte Carlo
13
14
Simple Methods
Monte Carlo methods are a straightforward and effective technique for evaluating
detail by Hammersley and Handscomb (1964), are discussed here for one-dimensional
integrals but are particularly powerful for multidimensional cases.In the simplest
case we wish to obtain the integral of f (x) over some fixed interval:
Z b
y= f (x)dx (3.1)
a
Monte Carlo solution to this problem via the ‘hit-or-miss’ (or acceptance–rejection)
method is to draw a box extending from a to b and from 0 to y0 where y0 > f (x)
throughout this interval. Using random numbers drawn from a uniform distribu-
tion, we drop N points randomly into the box and count the number, No, which fall
15
below f (x) for each value of x. An estimate for the integral is then given by the
fraction of points which fall below the curve times the area of the box, i.e.
Carlo method and is obviously dependent upon the quality of the random number
same approach with different random number sequences and by comparing these
There is a large class of problems which involve the solution of a differential equation
equation
∂ 2u ∂ 2u
∇2 u = + =0 (3.3)
∂x2 ∂y 2
where the function u(r) = f on the boundary. Equation (3.3) can be re-expressed
or
If we examine the behavior of the function u(r) at points on a grid with lattice
a grid of points in the xy-plane with a lattice spacing of ∆, then the probability of
a random walk returning to the point (x, y) from any of its nearest neighbor sites
16
is 1/4. If we place the boundary on the grid, as shown in Fig. 3.2, a random walk
will terminate at a boundary point (x′ , y ′ ), where the variable u has the value
One can then estimate the value of u(x, y) by executing many random walks
which begin at the point (x, y) as the average over all N walks which have been
performed:
1 X
u(x, y) ≈ f (x′i , yi′ ). (3.7)
N i
After a large number of such walks have been performed, a good estimate of
u(x, y) will be produced, but the estimate will depend upon both the coarseness of
local minima.
x∗ = min f (x)
x∈X
or
x∗ = max f (x)
x∈X
where:
• f (x) is the objective function, which may include noise, constraints, and
randomness.
Problem
A (0,0)
B (1,2)
C (4,3)
D (5,0)
Solution
– Route 1: A – B – C – D – A
– Route 2: A – C – B – D – A
– Route 3: A – D – B – C – A
• Route 1: A – B – C – D – A
p √
dAB = (1 − 0)2 + (2 − 0)2 = 5 ≈ 2.24
p √
dBC = (4 − 1)2 + (3 − 2)2 = 10 ≈ 3.16
p √
dCD = (5 − 4)2 + (0 − 3)2 = 10 ≈ 3.16
19
p
dDA = (5 − 0)2 + (0 − 0)2 = 5
• Route 2: A – C – B – D – A
p √
dAC = (4 − 0)2 + (3 − 0)2 = 25 = 5
p √
dCB = (4 − 1)2 + (3 − 2)2 = 10 ≈ 3.16
p √
dBD = (5 − 1)2 + (0 − 2)2 = 20 ≈ 4.47
p
dDA = (5 − 0)2 + (0 − 0)2 = 5
• Route 3: A – D – B – C – A
p
dAD = (5 − 0)2 + (0 − 0)2 = 5
p √
dDB = (5 − 1)2 + (0 − 2)2 = 20 ≈ 4.47
p √
dBC = (4 − 1)2 + (3 − 2)2 = 10 ≈ 3.16
p √
dCA = (4 − 0)2 + (3 − 0)2 = 25 = 5
20
Problem
A delivery service needs to find the shortest route between 5 delivery points in a
Points A B C D E
A 0 4.5 3.2 7.1 5.4
B 4.5 0 2.8 6.3 3.7
C 3.2 2.8 0 5.1 2.9
D 7.1 6.3 5.1 0 4.0
E 5.4 3.7 2.9 4.0 0
Solution
Possible random paths visiting all points once and returning to start:
• Route 1: A → C → B → E → D → A
• Route 2: A → B → E → C → D → A
• Route 3: A → D → C → B → E → A
Using the given table values, calculate total distances for each route:
21
Route 1:
Route 2:
Route 3:
Historically the examination of reactor criticality was among the first problems to
which Monte Carlo methods were applied. The fundamental question at hand is the
behavior of large numbers of neutrons inside the reactor. In fact, when neutrons
atom with a resultant fission event, particles fly off in random directions according to
the appropriate differential cross-sections (as the conditional probabilities for such
Neutron transport deals with the study of how neutrons move and interact with
22
materials. This field is fundamental in nuclear reactor design, shielding analysis, and
- E: Energy of neutrons.
Here are some other key equations used in Monte Carlo simulations of neutron
transport:
Mean Free Path: The mean free path λ for a neutron is given by the inverse
For anisotropic scattering, the scattering angle distribution can be modeled using the
scattering in neutrons:
1 1 − g2
P (µ) =
2 (1 + g 2 − 2gµ)3/2
Where:
The average scattering cosine (or mean cosine), ⟨µ⟩, is related to the asymmetry
parameter by:
⟨µ⟩ = g
a) Calculate the total cross-section and the mean free path for a neutron in this
material.
24
tering. Estimate the fraction of neutrons that will undergo at least one scattering
Solution:
b) What is the probability that a neutron will scatter in the forward direction, given
25
Solution:
a) The total macroscopic cross-section is simply the sum of the absorption and
scattering cross-sections:
tion P (µ), where µ is the cosine of the scattering angle, is given by:
1 1 − g2
P (µ) =
2 (1 + g 2 − 2gµ)3/2
For forward scattering, µ = 1, so the probability of scattering in the forward
direction is:
1 1 − g2
P (µ = 1) =
2 (1 + g 2 − 2g(1))3/2
1 1 − (0.5)2
=
2 (1 + (0.5)2 − 2(0.5)(1))3/2
1 1 − 0.25
=
2 (1 + 0.25 − 1)3/2
1 0.75
=
2 (0.25)3/2
Simplifying this gives:
0.75
P (µ = 1) = 0.5 × = 0.5 × 6 = 3
0.125
This result indicates a higher probability for forward scattering in this case due to
4.1 Mathematics/Statistics
Monte Carlo methods are computational techniques that use random sampling to
are difficult or impractical. These methods are named after the Monte Carlo casino
due to their reliance on randomness, and they are widely used in diverse areas
inference.
Simpson’s rule are inefficient. By randomly sampling points in the domain, these
26
27
to solve optimization problems, particularly when searching for the global minimum
of a complex function. These methods are particularly useful for problems in high-
and is used in various applications such as Bayesian inference and statistical physics.
such as confidence intervals or standard errors. This allows for non-parametric in-
Random Walks and Diffusion Processes: Monte Carlo simulations are used
to model random walks, which describe paths consisting of random steps. These
models are widely used in fields like diffusion theory, stock market analysis, and
particle physics.
lent in fields such as finance, physics, and biology, where systems are influenced by
28
random factors.
4.1.2 Advantages
*Handling Complexity: Monte Carlo is ideal for systems that are too complex for
quantify uncertainty, making them valuable for risk analysis and decision-making
under uncertainty.
4.2 Econophysics
mechanics and complex systems, to study financial and economic systems. In this
field, Monte Carlo methods are commonly used to model and simulate financial
Stock Price Modeling: Monte Carlo simulations model the randomness in asset
prices, using probabilistic models like Geometric Brownian Motion (GBM) to gen-
mate portfolio risk, including techniques like Value at Risk (VaR) to assess potential
Option Pricing: Monte Carlo simulations are used to price complex financial
derivatives, such as Asian options, where traditional formulas like Black-Scholes are
29
(e.g., traders) to study how individual behaviors impact overall market dynamics,
Extreme Events: Monte Carlo is used to simulate extreme financial events (e.g.,
market crashes), helping estimate the likelihood of rare but impactful occurrences
Systemic Risk and Network Models: Monte Carlo methods help model the in-
crises.
4.2.2 Advantages
*Risk Estimation: Provides insights into the probability of different financial out-
Monte Carlo methods in econophysics are a powerful tool for understanding and
and model market behaviors. While they offer valuable insights, they are computa-
4.3 Astrophysics
Monte Carlo methods are vital computational tools used in astrophysics to simu-
late complex physical systems where analytical solutions are not feasible. These
and matter.
Radiative Transfer: Monte Carlo methods simulate how light (or other ra-
diation) interacts with matter, such as photons passing through stars, nebulae, or
interstellar gas clouds. This helps astrophysicists understand the emitted radiation,
lations model the evolution of large-scale cosmic structures, such as galaxies and
clusters, from the early universe to the present day. These simulations are essential
for testing different cosmological theories, including those involving dark matter and
Particle Physics and Cosmic Rays: These methods are used to trace high-
energy cosmic rays as they interact with the Earth’s atmosphere or interstellar mat-
phenomena like cosmic ray showers, particle acceleration, and gamma-ray bursts.
in supernovae, helping predict their light curves, spectra, and the interaction of
radiation with the surrounding environment. This is crucial for understanding the
black holes and neutron stars, Monte Carlo simulations help model complex pro-
cesses like photon absorption, scattering, and re-emission within accretion disks.
These simulations aid in understanding X-ray emissions and the physical conditions
31
tial sources of gravitational waves, such as mergers of compact objects, and predict
the signals detected by observatories like LIGO. These simulations help interpret
real data and refine our understanding of cosmic events that produce gravitational
waves.
Galaxy and Star Formation: Monte Carlo methods are used to model the
stochastic processes involved in star and galaxy formation, including gas cloud col-
lapse and stellar evolution. This provides insight into how galaxies and stellar
4.3.2 Advantages
tions.
tists to tackle problems too complex for traditional analytical methods. They offer
powerful tools for modeling everything from cosmic ray interactions to the formation
of galaxies and the dynamics of black holes. Despite the computational demands,
32
the flexibility and accuracy they provide make them a cornerstone of astrophysical
research, allowing for deeper understanding of the universe’s most mysterious and
dynamic processes.
Monte Carlo Traffic Simulation uses random sampling and probabilistic models to
simulate and analyze traffic flow, congestion, and interactions in transportation sys-
conditions.
Traffic Flow and Congestion: Monte Carlo methods simulate vehicle arrivals,
traffic signals, and lane changes to predict congestion and delays, helping optimize
crosswalks and vehicle interactions, accounting for random events such as accidents
or lane changes.
Traffic Signal Timing: Monte Carlo simulations help optimize traffic signal tim-
ings by modeling random vehicle arrivals and testing different traffic light cycles to
frastructure (e.g., new roads or intersections) affect traffic flow, helping planners
helping to identify accident hotspots and assess the effectiveness of safety measures
4.4.2 Advantages
conditions.
*Scenario Exploration: Helps assess various ”what-if” scenarios for better decision-
making.
Monte Carlo methods offer powerful tools for simulating and optimizing traffic sys-
tems, improving traffic flow, road safety, and environmental impact assessments.
Despite challenges in computation and data accuracy, they provide valuable insights
4.5 Finance
Monte Carlo methods are a class of computational techniques that use random sam-
methods are particularly useful for pricing complex financial derivatives, managing
Option Pricing: Monte Carlo simulations are widely used to price options when
traditional closed-form models, like Black-Scholes, are not applicable. For example,
cated features benefit from Monte Carlo due to its flexibility in handling various
Risk Management:
*Value at Risk (VaR): Monte Carlo simulations help estimate the potential
34
losses in a portfolio by simulating many different market scenarios. This helps as-
sess how much risk the portfolio is exposed to under various market conditions.
*Stress Testing: The method is useful for testing how a portfolio would behave
under extreme market events, such as market crashes or sharp volatility spikes.
helps identify optimal combinations of assets that achieve desired risk-return objec-
tives.
Interest Rate and Credit Risk Modeling: Monte Carlo techniques are used to
simulate the behavior of interest rates and assess the pricing of fixed-income instru-
ments and derivatives. Similarly, credit risk simulations help assess the likelihood
Real Options Analysis: Monte Carlo methods allow for a more nuanced valuation
4.5.2 Advantages
*Flexibility: Can be applied to nearly any financial model, regardless of its com-
plexity.
*No Closed-Form Solution Needed: Particularly useful for models that lack a
*Accuracy: With enough iterations, Monte Carlo simulations can provide very
Monte Carlo methods are a versatile and powerful tool in modern finance, enabling
portfolios. Despite the computational cost, their ability to provide solutions where
35
traditional methods fail makes them indispensable for financial analysis, especially
Monte Carlo simulations often require a large number of random samples to achieve
2. Slow Convergence
like finite difference or finite element methods. The error decreases proportionally
√
to 1/ N , where N is the number of samples, meaning that improving accuracy
3. Noisy Results
Since Monte Carlo relies on random sampling, results can have high statistical noise
unless a very large number of samples is used. This makes it difficult to achieve
Monte Carlo methods are most effective for high-dimensional or highly random sys-
tems. However, for problems with low variance (e.g., laminar fluid flow), determin-
istic solvers like computational fluid dynamics (CFD) methods (e.g., Navier-Stokes
Monte Carlo methods struggle to capture continuous properties like fluid velocity
36
ber of samples.
To improve efficiency, Monte Carlo methods often require variance reduction tech-
implementation.
Monte Carlo methods are generally not well-suited for time-dependent fluid flow
problems, as they require extensive sampling at each time step, making simulations
impractically slow.
Conclusion
In conclusion, this exploration of Monte Carlo methods has illuminated their re-
markable versatility and power in tackling complex problems across diverse fields.
these methods and witnessed their application in solving real-world challenges. The
nature of these techniques and their profound impact on scientific and economic
thought. While Monte Carlo methods offer a powerful toolkit for understanding
convergence and the potential for statistical error. Careful consideration of sample
size, variance reduction techniques, and the specific characteristics of the problem
at hand are essential for ensuring the accuracy and reliability of Monte Carlo simu-
lations. Despite these considerations, the ability of Monte Carlo methods to bridge
the gap between theoretical models and real-world observations solidifies their po-
37
38
computational power continues to grow, we can anticipate even wider adoption and
further refinement of these powerful techniques, paving the way for deeper insights
[1] Malvin H. Kalos and Paula A. Whitelock, Monte Carlo Methods- Second,
Revised and Enlarged Edition, WILEY-VCH Verlag GmbH and Co. KGaA,
Weinheim, 2008
[2] David P. Landau and Kurt Binder, A Guide to Monte Carlo Simulations in
[3] N. Metropolis, and S. Ulam, The Monte Carlo Method, Journal of the Amer-
[4] Kroese, D. P., Brereton, T., Taimre, T., Botev, Z. I. Why the Monte Carlo
[5] Hastings, W. K. Monte Carlo Sampling Methods Using Markov Chains and
[6] Rubinstein, R. Y., Kroese, D. P. Simulation and the Monte Carlo Method.
[7] Robert, C. P., Casella, G. Monte Carlo Statistical Methods. Springer, New
York, 2004.
39