Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding PI Value using "Dart Board Method"

Tags:

algorithm

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.

like image 200
itsaboutcode Avatar asked Nov 25 '25 22:11

itsaboutcode


2 Answers

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.

like image 175
Steve Jessop Avatar answered Nov 28 '25 16:11

Steve Jessop


For a start maybe the more known name helps you

Monte Carlo Integration (aka DartBoard Method)

like image 30
jitter Avatar answered Nov 28 '25 15:11

jitter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!