Scanning for π

August 27, 2013

In a previous episode, we looked at how we could use random sampling to get a good estimate of \pi, and found that we couldn’t, really, unless using zillions of samples. The imprecision of the estimated had nothing to do with the “machine precision”, the precision at which the machine represents numbers. The method essentially counted (using size_t, a 64-bits unsigned integer—at least on my box) the number of (random) points inside the circle versus the total number of points drawn.


Can we increase the precision of the estimate by using a better method? Maybe something like numerical integration?

Read the rest of this entry »

A matter of interpretation

May 18, 2010

In calculus 101, amongst the first things we learn, is that the derivative a function is the slope of the tangent to the function, that is, the instantaneous slope at some point on the function. We have, for some function F that the derivative f is given by:

\displaystyle\frac{\partial\:F}{\partial\:x}=\lim_{\Delta\to{}0} \frac{F(x+\Delta)-F(x)}{(x+\Delta)-x}=\lim_{\Delta\to{}0}\frac{F(x+\Delta)-F(x)}{\Delta}=f

So the formulation looks like a slope, and it is taught that it is a slope as well; all the concepts surrounding differentiation are expressed in terms of slopes of tangents, and that’s OK, because that’s what they are.

But suddenly, in calculus 201, we learn how to find the anti-derivative of a function, also known as the integral. But the metaphor changes completely: we’re know talking about the area under the curve. Wait. What?

Read the rest of this entry »