Line 3: Line 3:
 
Suppose we want to find the area of the circle given below. Here we can apply the '''Monte Carlo Method'''
 
Suppose we want to find the area of the circle given below. Here we can apply the '''Monte Carlo Method'''
  
<math>1</math> First we enclose the circle with a square. Suppose we find that the length of each side of square in this case is 2 units. Thus the radius of the circle is <br>1 unit. Hence we should look for an answer close to <math>\pi*r^{2}= 3.14</math><br>
+
<math>1</math> First we enclose the circle with a square. Suppose we find that the length of each side of square in this case is 2 units. Thus the radius of the circle is <br>1 unit. Hence we should look for an answer close to <math>\pi*r^{2}= \pi*1*1=3.14</math><br>
 
<math>2</math> Now first step is that we sample random points on the square. Now we calculate the number of points falling inside the circle and the number of points falling outside the circle.<br>
 
<math>2</math> Now first step is that we sample random points on the square. Now we calculate the number of points falling inside the circle and the number of points falling outside the circle.<br>
  

Revision as of 17:23, 6 October 2008

Simple example showing how to Find Area of Circle ( THE COOL WAY!)

Suppose we want to find the area of the circle given below. Here we can apply the Monte Carlo Method

$ 1 $ First we enclose the circle with a square. Suppose we find that the length of each side of square in this case is 2 units. Thus the radius of the circle is
1 unit. Hence we should look for an answer close to $ \pi*r^{2}= \pi*1*1=3.14 $
$ 2 $ Now first step is that we sample random points on the square. Now we calculate the number of points falling inside the circle and the number of points falling outside the circle.

File:Monte carlo method.gif ECE302Fall2008sanghavi

Now, $ p=\frac{no. of .points .inside .the .circle}{no. of .points .inside .the .circle. + no. of. points. outside. the. circle.}. $

Suppose we get 800 points in the circle and 200 points outside.
Thus,

$ p=\frac{800}{800+200}. $

Therefore $ p=\frac{800}{1000}=0.8. $

Hence, $ the .area .of .circle = p * area. of .square $ <=math>4 * 0.8</math>
=$ 3.2 $

Here the value found is approximate and by taking more number of points we can get a more precise answer.

Alumni Liaison

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood