Line 1: Line 1:
 +
== 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'''
 +
 +
<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}</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>
 +
 
[[Image:Monte_carlo_method.gif‎ _ECE302Fall2008sanghavi]]
 
[[Image:Monte_carlo_method.gif‎ _ECE302Fall2008sanghavi]]
 +
 +
Now, <math>p=\frac{no. of .points .inside .the .circle}{no. of .points .inside .the .circle. + no. of. points. outside. the. circle.}.</math>
 +
 +
Suppose we get 800 points in the circle and 200 points outside.<br>
 +
Thus,<br>
 +
 +
<math>p=\frac{800}{800+200}.</math>
 +
 +
Therefore <math>p=\frac{800}{1000}=0.8.</math>
 +
 +
Hence, <math>the .area .of .circle = p * area. of .square</math>
 +
<=math>4 * 0.8</math><br>
 +
=<math>3.2</math><br>
 +
 +
Here the value found is approximate and by taking more number of points we can get a more precise answer.

Revision as of 17:20, 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} $
$ 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

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang