Drills and Needles

I swear it was a coincidence.  We really didn't set out to show Darren Aronofsky's first film, \(\Pi\): Faith in Chaos so close to Pi Day; it just happened that way.  If you've never seen it, you should.  It's available on Netflix and on Amazon Prime, and on VHS (!) in the UF Library.  Remarkably, campus classrooms are equipped with dual VHS/DVD players so we went with that instead of risking buffering problems.  Side note:  the previews (remember those?) included Dee Snider's Strangeland, and a promo for the DVD version of \(\Pi\) (the format of the future!). 

I'll not editorialize about Pi Day.  Well, ok, I will a bit.  Some mathematicians despise it.  Vi Hart, internet math video maker extraordinaire (seriously, spend a few days of your time watching her stuff) has a rant about it.  Here at UF the fine folks at the science library, in conjunction with some engineering student groups, had a Pi Day celebration, complete with faculty taking pies in the face and contests for who could recite the most digits of \(\pi\).  I don't hate it, but I don't love it, either.  I tend to fall in the "there's no such thing as bad publicity" camp, but I wouldn't mind a bit more substance.  There are lots of interesting places \(\pi\) shows up, and I wish people knew more about them instead of trying to get the first \(1,000\) digits (or whatever).  I only know \(\pi\) up to \(3.141592653\), which is waaaaayyyyy more precision than you'd ever need for any practical calculation.  Hell, engineers are perfectly happy with \(22/7\) or even \(3\) for a back-of-the-envelope calculation.  The legislature of Indiana once introduced a bill that implied that \(\pi\) equals \(3.2\); luckily it didn't pass. 

Anyway, the movie.  It's a jarring film, shot in high-contrast black and white with some rapid editing and off-kilter camera angles.  It's the story of Max Cohen, a mathematician living in New York's Chinatown, who is trying to find patterns in the stock market.  His computer, Euclid, develops a bug and right before it crashes it spits out a couple of stock picks and a \(216\)-digit number.  At first glance, the stock prices seem completely implausible, but they later turn out to be correct (gasp!).  The number is another story.  We get taken on a ride into Jewish numerology via Lenny, who Max meets in a diner, and into the seamy underside of Wall Street finance via Marcy, who is hounding Max to get him to work for them and even offers him a classified processing chip to help him along.  I'll save the analysis for the next post since we were all a bit wiped out by the end of the film and needed some time to process it before having a thoughtful discussion.

After a break, I talked about \(\pi\) a bit.  We all know it's defined as the ratio of a circle's circumference to its diameter (or twice the radius); it's also equal to the ratio of a circle's area to the square of its radius.  The latter definition is actually better in some ways as it's possible to prove the area formula for a circle via simple geometry (Euclid did it in his Elements) while the circumference formula is a bit trickier (and, if we're being honest, really requires the idea of limit, which Archimedes didn't have but which he almost invented).  As for the calculation of \(\pi\), Archimedes got as far as \(3.1415\) by the method of inscribing and circumscribing polygons on the circle and calculating the resulting perimeters.   

But here's an interesting way to calculate \(\pi\), using toothpicks and a piece of posterboard.  Mark off parallel lines on the board at distances equal to the length of a toothpick.  Now ask yourself the following question: if I drop a toothpick onto the board, what is the probability that it crosses a line?  Here's a picture:

now here we go, droppin' science, droppin' it all over...

now here we go, droppin' science, droppin' it all over...

I had the class come up and drop some toothpicks.  We had \(15\) people drop \(10\) toothpicks each.  We got \(105\) hits in the \(150\) attempts for a probability of \(0.70\).  Of course, if we dropped more we would get a better estimate of the probability.  In fact, the real answer is about \(0.6366\), which you can figure out by doing a lot of simulations.  Here's a web app that will do that for you. 

Now, I'm going to do something to that number:  first, I'll invert it to get \(1.5708451\dots\); then if I multiply that by \(2\) I get \(3.14169\dots\).  That looks an awful lot like \(\pi\), which begs the question:  why would \(\pi\) show up in this context?  I mean, I don't see circles anywhere and \(\pi\) means circles, right?

But if you think about it for a minute, it shouldn't be that surprising.  Here's a schematic:

simplified schematic

simplified schematic

The toothpick has length \(1\) unit, which is the distance between the lines.  Let \(d\) be the distance from the midpoint of the toothpick to the nearest line (\(0\le d\le 1/2\)) and let \(\theta\) be the angle it makes with the horizontal (\(0\le\theta\le\pi\)).  See that \(\pi\)?  Anyway, we get a hit exactly when \(d\le (1/2)\sin\theta\).  That corresponds to the blue region in the picture below.

keep it blue

keep it blue

So the probability of a hit is then \[p = \frac{\text{area of blue region}}{\text{area of rectangle}} = \frac{\int_0^\pi 0.5\sin\theta\,d\theta}{0.5\pi} = \frac{1}{0.5\pi} = \frac{2}{\pi}.\]  I'll let you get out your calculator and check that this equals \(0.6366\dots\).

This is certainly not the only place \(\pi\) shows up unexpectedly, nor is it the most efficient way to calculate \(\pi\).  Archimedes' method of exhaustion is, well, exhausting to carry out in practice and until a couple hundred years ago it was the way to go.  The discovery of infinite series that sum to things involving \(\pi\) has made the calculation of \(\pi\) much more tractable.  For example \[\frac{\pi}{4} = \sum_{n=0}^\infty \frac{(-1)^n}{2n+1}.\]  Or \[\frac{\pi^2}{6} = \sum_{n=1}^\infty \frac{1}{n^2}.\]  Or, (thanks Ramanujan) \[\frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum_{n=0}^\infty\frac{(4n)!(1103+26390n)}{(n!)^4 396^{4n}}.\]

OK.  That's a lot of formulas for computing a number that is only special because it's related to circles.  There are plenty of interesting numbers \(e,\sqrt{2},\dots\) that are just as (more?) fascinating than \(\pi\) but which don't get the same slavish devotion.  Why?  Probably just because of the circle thing--it's defined as a ratio but it's an irrational number (transcendental, even).  But sometimes, as the movie infers, this devotion pushes dangerously close to insanity.  It at least often devolves into numerology.  Superstition.  Finding patterns when they aren't there.  Something wicked this way comes...