Skip to content

Latest commit

History

History
18 lines (10 loc) 路 1.6 KB

README.md

File metadata and controls

18 lines (10 loc) 路 1.6 KB

Visualizing Methods of Estimating Pi

I started working on this project to explore the various ways of approximating the value of 蟺. What I enjoyed the most about working on this project is how nicely D3.js can be integrated with React to design visually stimulating and interactive graphs.

Methods

Several methods of estimating 蟺 were used in this project. The following list explains each method and how it works.

Area of a circle inscribed in a square

Area of Circle Image

This method of approximating 蟺 revolves around the idea that the ratio of the area of a circle to the area of the square it is inscribed within is equal to an expression in terms of 蟺. By approximating the ratio, we can derive an approximation of 蟺. We can approximate the area using the Monte Carlo method, which is basically the process of randomly picking points from the area of the square. The proportion of points within the circle is an unbiased estimate of the ratio of the areas.

Buffon's Needle

Buffon's Needle Image

The Buffon's Needle problem asks for the probability of a needle of length l landing on a line, given that the floor contains parallel lines equally-spaced with distance d. The general form of this problem does not place any restrictions on l and d. If we consider the simple form of the problem, when l=d, the probability is equal to 2 / 蟺. By randomly "dropping" needles and calculating the proportion of needles crossing a line, we can approximate the probability and thus derive an estimate for 蟺.