views:

189

answers:

4

Hi,

I'm trying to find the value of PI using the "Dart Board Method" but I've been unable to find a relevant algorithm on the net. Do you know of a link which can help me to understand this method and also provides an algorithm for this?

Thanks.

+2  A: 

For a start maybe the more known name helps you

Monte Carlo Integration (aka DartBoard Method)

jitter
+3  A: 

Summary: consider a 1x1 square. Its area is 1.

Consider a circle which fits just inside the square. Its area is pi * r * r, which is pi / 4.

So, if you throw a squillion darts at that square (and they all hit, and their x and y co-ordinates each have independent uniform distribution), then for any subset of that square, you'd expect the proportion of the darts inside it to be equal to the area of the subset as a proportion of the area of the square.

So count how many darts fall inside the circle (by measuring whether the distance from the dart to the centre of the square is greater than or less than 1/2), divide by a squillion, multiply by 4, and you have a Monte Carlo estimate of pi.

Steve Jessop
A: 

OK i have found the solution here, it present the code and also help me to understand it better, basically i was also confused on how to know if this is within circle lox I have to work on my math!

http://books.google.com/books?id=JlG5rFH7Ge0C&pg=PA39&lpg=PA39&dq=Dartboard+Method+algorithm&source=bl&ots=t76R30Q342&sig=NjguOYMc0ILqZs8Bcz6uIpfejdc&hl=en&ei=-YzTSuutFMefkQXj9%5FH7Aw&sa=X&oi=book%5Fresult&ct=result&resnum=6&ved=0CCIQ6AEwBQ#v=onepage&q=&f=false

itsaboutcode