On March 14th, i tweeted “Surely today is American pi day. I’ll be celebrating on July 22nd along with the rest of the sane date ordering world.”

Apart from poking gentle fun at date ordering, i do have mathematical reasons to like 22/7 more. As i mentioned in a follow up tweet, 22/7 is a better approximation to π than 3.14 in an absolute sense – 22/7 is within 0.0013 of π, whereas 3.14 differs from π by just under 0.0016. I am swimming against the tide though – even Wikipedia calls 22/7 Pi Approximation Day, reserving Pi Day for the less accurate 3.14.

However, it was a reply from a friend pointing me at All Rational Approximations of Pi Are Useless which spurred me to action, in as much as blogging is action. Apart from the fact the provocative title is demonstrably false – i use a rational approximation of π (typically 3) all the time to estimate the volume of cake tins amongst other things, that article really deserves critiquing. The claim is that rational approximations are useless because they are no better than remembering decimal digits. Already we can see this depends on what you mean by better – 22/7 is better than 3.14 for the same number of digits, if by better you mean “closer in absolute value”. Ah, but his version of better is “correct digits when expanded in base 10” – in other words – a definition skewed towards base 10!

Let’s think it through a bit more – in base 10, we have 3.14 = 3 + 1/10 + 4/100, whereas π = 3 + 1/10 + 4/100 + 1/1000 + 5/10000 + …

So what is a fair comparison for 22/7 ? Surely its base 7! Here, 22/7 = 3 + 1/7, whereas π = 3 + 1/7 + 0/49 + 0/343 – 3/2041 + … . The denominators here are the powers of 7, and i’ll allowed myself “negative digits” to make clear how close the value is. So in fact, 22/7 gets three fractional base 7 digits right, for only one fractional part (1/7). The approximation 3.14 needed two fractional parts (1/10 and 4/100) to get, umm, 2 digits right … hopeless!

Another way to think about how good a rational approximation *p/q* is to an irrational *a* is to look at the absolute difference between *p/q* and *a* as a power of *q*. In symbols, find *k* so that |*p/q – a*| < 1/

*q*

^{k}. One way to think about this is that this is what matching to

*k*places base

*q*means. Another way to think about it is that for any

*q*you can get within 1/2

*q*of a just by picking the

*p*that makes

*p/q*closest. It’s only for special

*q*that you can do better. How does 22/7 do ? Well, the absolute difference between 22/7 and π is about 7 to the power 3.4 – which accords with our 3 digits right above. There are other great appromxiations, for example 333/106 gives just over 2 by this measure, and 355/113 gives 3.2 by this measure.

Back to the article – the author finds 355/106 by brute force, and then searches to 10,000 to no avail. There’s a good reason for that – the next great rational approximation of π is 103993/33102. Of course, the way to find these is not brute force, but by thinking. That is to say, by doing maths – specifically the theory of continued fractions. His brute force technique finds 99/70 as an approximation to √2 – again, this value is predicted by the theory of continued fractions – it takes about under 60 seconds of *hand* computation to find it once you have the theory – no need to throw the massive computation engine of Mathematica against a problem which has an elegant and well understood theory behind it.

A mathematician and friend who will remain nameless for now once suggested to me that Kepler would not have made his ground breaking work in planetary motion if he had had access to Mathematica. At the time, planetary motion was predicted via epicycles, an approximation technique. The claim is that it was the difficulty in getting better approximations via epicycles – the calculation just gets too hard – that drove Kepler to look for, and find, a correct theoretical solution that was also elegant and practical for computation. Had humanity had a computation engine capable of computing epicycles, it might have been generations before his inventions were made in the absence of their mother necessity.

*Postscript*

I want to leave it there, but feel i must observe that i’m not against machine computation – far from it – computers have enabled fantastic progress and contributed significantly to human wellbeing. However, i do have a sympathy for the point of view that being required to find a theoretical solution in order to make practical progress can lead to discoveries that you miss if you’re overly focused on answers because you can find them easily. It’s the journey, not the destination.

March 16, 2013 at 10:21 am |

> So what is a fair comparison for 22/7 ? Surely its base 7!

Actually I’d say that’s unfair… to base 7. Digits in base 10 contain 18% more information than base 7. To correct for this, I’d divide your measure by log(b) where b is the base. This give 22/7 a still stronger lead, but makes 3.14 better than the other convergents.

I think your broader argument about the reliance on brute force neglects the practical reality that almost all problems we face are simpler (or even trivial) if only we know the correct theory. The trouble is that we don’t necessarily know the correct theory (in fact, it might not be known by anyone yet) and there’s a cost and risk in acquiring the relevant theory. When you write “not brute force, but by thinking” what you really mean is “not brute force, but by study and a little thought”, unless you worked out the theory of convergent fractions yourself (and even then, it would be rather haughty to expect everyone else to do it too).

The original Wolfram post demonstrates how a piece of software can help you discover some truths without knowing the theory, though obviously the theory is better if you happen to know it. The post is also about best utilising human memory, and for good or bad, all our memories are configured with a bias to base 10. Personally, I favour the dozenal system (http://hexnet.org/content/excursion-numbers) if only the switching costs weren’t so high, though the reasons for that are connected to working with rational numbers rather than any particular irrational one.

I also think that the original post doesn’t take itself quite as seriously as you treat it. It’s a fun game playing with a tool rather than a proof of anything serious or practical.

Thanks for posting your thoughts.

Cheers,

Mark

March 16, 2013 at 4:57 pm |

Thanks for you thoughts Mark. I agree with a lot of what you say, especially the need to experiment in order to find truths, and you are correct that “study and a little thought” would have been a better choice of words. While i understand why base 10 plays a special role, i think it is misleading to count 3.14 as 4 characters rather than treat it as the 7 characters 314/100 given the way 22/7 is assessed. Maybe i am taking a light hearted post a little seriously …

On the topic of experimentation – yes it is vital to find truths before we have the theory. What bothers me is the article discovers some interesting things by experimentation and completely fails to ask the question of where these things come from, when there is a beautiful theory here, which pretty much any mathematician with a passing acquaintance with number theory would know. If a company which notionally produces mathematical tools doesn’t do this, then i think that’s a bit sad. They had a great opportunity to snare a passing reader with an interesting question, some experimentation, and pointers to theory discussing deep truths. Again, maybe not the point of the article … however, it is good for passing readers to realise that a bit of experimentation can, and usually does, lead deeper when you ask the right questions.

Finally, it gave me a chance to tell the Kepler counterfactual anecdote which i like. I do think this was a case of “oh, that’s cute” and failing to followup and thus missing something really nice.

May 2, 2013 at 8:41 am |

Meanwhile, others at Wolfram have been working on continued fractions; you may be interested in http://blog.wolfram.com/2013/05/01/after-100-years-ramanujan-gap-filled/