Professional Documents
Culture Documents
College of Engineering
Electrical Engineering Dept
Computer Simulation of Engineering Systems (GE-501)
Mini Project-3
Monte-Carlo Simulation
Khalid Al hamawi
Assigned to: Professor Adel Abdennour
1/10/2013
Abstract Monte Carlo methods are often used in simulating physical and
mathematical systems. The idea of using Monte Carlo method is by generating
random point then performs a deterministic computation on the inputs. This report
contains a Monte-Carlo simulation of Buffons Needle experiment. MATLAB is used
to simulate this problem.
i.
Introduction:
Monte Carlo simulation is called after the city in the Monaco principality, because of
roulette, a simple random number generator. The name and the systematic
development of Monte Carlo methods date from about 1944.
A Monte Carlo simulation is a statistical simulation technique that provides
approximate solutions to problems expressed mathematically. It utilizes a sequence
of random numbers to perform the simulation.
This technique can be used in different domains:
1. Complex integral computations.
2. Economics especially in risk management.
3. Making decisions in specific complex problems.
The real use of Monte Carlo methods as a research tool stems from work on the
atomic bomb during the Second World War.
ii.
Buffons Needle:
Buffon's Needle experiment is one of the most famous in probability theory. It refers
to a simple Monte Carlo method for the estimation of the value of pi (). As shown
in figure1, A needle of unity length is thrown randomly somewhere in between the
two parallel lines. The two parallel lines separated by a distance L making a random
angle at a random distance d (from the center of the needle to the line). It is
assumed that 1L to guarantee that the needle can only touch one line, at most, each
time it is thrown. As shown in figure 1, the needle will touch the line if the distance d
is smaller than or equal to 1/2 times the sin of . That is, d 1/2*sin ().
1/2*sin ()
iii.
L/2
1/2*sin ()
1/2
The entire sample space has an area of the rectangle, L/2* = L*/2. The event of an
intersection happens in the shaded region, which can be calculated by the integral:
The probability is the ratio of the shaded area to the entire area, which is:
From equations :
If:
Then:
And that is how Buffons needle problem can be solved mathematically and why the
constant appears in the answer.
iv.
MATLAB Simulation:
The simulation of Buffon's Needle problem is carried out by using MATLAB.
Table 1 shows the values of (n, c, pi) for different values of (L, N). as shown in
table 1 the number of intersections (n) increases with increasing the number of
throws (N), and it decreases with increasing the distance between the two lines
(L). On the other hand the constant (c) increases with increasing (L) but, the
number of throws (N) doesnt affect too much the constant (c). Also the values of
pi () in table 1 are very close to the real one and it comes closer with increasing
the number of throws and decreasing the distance between the lines.
Table 1
N=100
n
N=1000
pi
N=10000
pi
pi
L=1
L=2
L=3
24
L=4
L=5
v.
Conclusion:
As shown in table 1 the best result of pi () and the closet to the real value was
3.1407 after 10000 throws. So Monte Carlo is an extremely bad method it should
be used only when all the alternative methods are worse, because all numerical
methods are potentially dangerous compared to analytic methods. As numerical
methods go, Monte Carlo is one of the least efficient. It should be used only on
those intractable problems for which all other numerical methods are even less
efficient.
vi.
References: