Tuesday, September 29, 2015

Impenetrability of values of π

What is π?

Wait... before you spit out digits you memorized for that competition, what does it mean first? It is the ratio of the circumference of a circle to its diameter. That also seems a little weird because it's easy to measure a straight line against a straight line, but not against a weird curve. Rulers just don't work. But there's an easy way around that. Use a string, which is infinitely flexible, just make sure it is taut when measuring.

But it's still kind of weird. Who would've bothered to think to care about a ratio? (OK, it's easy to bother...you can walk around a circular castle, how long is it across?) But now that we've started thinking, π is a constant? That's also weird... why would you care? (well, it helps to simplify things and constants are simpler than variables, so...) It's obviously (once pointed out) more than 3 (inscribed regular hexagon) and less than 4 (circumscribed square). Anyway, it appears in quite a few mathematical places seemingly beyond geometry (eg the normal curve, the analytic continuation of the factorial: Γ(1/2) = sqrt(π)), for no apparent reason (well that's what inscrutability is all about!)



Sure, there are calculations with varying degrees of inscrutability: Archimedes' method (pictured), the Taylor expansions (Euler's π/4 = arctan 1, Machin's  π/4 = 4 arctan 1/5 - arctan 1/239), the continued fraction expansion, Chudnovsky's method, the BBS spigot algorithm,

So I think I've dispensed with the impenetrability of π. I've made the tiniest of mathematical scratches and there's a long way to go. But I don't want to go there now. I want to explore the impenetrability of the value of π. The 3.1415926535... that value.

How big is π? Right, a little more than 3. But what is the point really? If you're shooting an arrow across the castle, 'a little more than 3' will do. If you're tying a rope across that 3.14 will do (and you'll want some slack anyway which will wash away any more digits. 

The fraction 22/7 is often given as an easy approximation (= 3.142854...). But what's the point? to remember that fraction (3 digits plus where the division goes, or two small numbers) is just as much as the decimal explnsion 3.14. And 22/7 is somewhat impenetrable itself (oh fourth grade nightmares of fractions!) 7 goes into 22 ... argh how many times ... oh 3 plus what's left over .. hmm.. one seventh) Just use 3.14 and cut out all that nonsense. 

The next best continued fraction expansion is 355/113. Six digits (slightly mnemonic in repeats, but really somewhat random) It gets you 3.14159292... seven correct digits (yes I'm fudging the rounding). But then do you really want to remember that fraction and have to divide 355 by 113? Yechh. Even plain old division is way more impenetrable than just a list of digits (as long as the calculation of those digits is correct). Essentially, I'm saying that 355 divided by 113 is just as impenetrable (in your head) as 4 arctan 1 (and roughly the same calculator button presses).

So what do you really need? If your castle of one kilometer in circumference is measured around in (oh I didn't explain why measuring around to calculate diameter rather than the other way... presumably you're in a siege around the castle and you need to shoot arrows all the way across. It's a use case that comes up more often than you'd think)...measured around with a rope to a precision of within a meter (oh I love decimal) 3 digits, a millimeter 3 more, and already the stretchiness in a kilometer of rope or errors in laying measuring tape a hundred times is way beyond a millimeter.

If you want to explore the digit patterns in π, then, totally, go for the spigot algorithm (oh yeah if you don't mind them in hex).

If you're measuring the circumference of the observable universe to the precision of the radius of a hydrogen atom (you never know when that might matter), then you really need at most 39 digits (46.6 billion ly = 8.8×1026 m /  5.29×1011m ... oh looks more like 38 digits is enough (26 + 11 + 1?).  

But if you're shooting arrows (or painting a storage tank), just use 'a little over 3' and you're gonna add a slop factor anyway because there's lots of little engineering give and take you have to compensate for.

Well, whichever, measure twice, cut once.

(What would I do if I were programming a Mars lander? Hell, yeah, double precision or more!)

No comments: