Please update (reload) page (by pressing Ctrl+R) if you don't see images.


Approximation of p with the Monte Carlo Method
Prof. Massimo Priano and Dr. Valery Ochkov
(see too http://en.wikipedia.org/wiki/Monte_Carlo_method )
If a circle of radius r = 1 is inscribed inside a square whit side length L = 2, then we obtain
So the ratio of the area of the circle to the area of the square will be
Inside the square, we can put n points at random
with uniform distribution with (x,y) coordinates.
In Mathcad we can define (x, y) as follows:
We obtain
Now, we can to count how many points have fallen in the circle :
The result is:
If n is large enough, we can think that the ratio
is approximately equal to
and so
is approximately equal to
We have obtained one approximation for p
with error

Made with Mathcad Application Server

This web page generated by Mathcad Application Server

 

You can also visit our products site at http://www.trie.ru

Made with WaterSteamPro

This web page can use the WaterSteamPro functions

Softline logo

Softline is MAS/MPEI partner