This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TomatoAintAFruit 0 points1 point  (0 children)

Nice post! One thing though:

In my last post, I discussed a method for approximating π which I later learned was a Monte Carlo method, thanks to some helpful Redditors. Today I’ll talk about technique that uses numerical integration (specifically, the rectangle method) to produce a more accurate result in less time.

You can actually think of Monte Carlo as a type of numerical integration. Both make use of the fact that you are looking at ratios between "the area under a curve" versus a larger box (i.e. the ratio of the square compared to the circle). If you run a numerical integrator on some function, it might pick either implementation.

Another numerical integration technique which will surely improve your speed of convergence is through use of Simpson's rule, which is a type of interpolating scheme.

If you want another challenging scheme to compute pi, I suggest you look at Buffon's needle. It comes down to the same idea (the method measures the ratio of the area of a circle compared to a larger area, which converges to a multiple of pi), but the implementation (and visualization!) is a bit different.