Live data from Hacker News

All Rational Approximations of Pi Are Useless

blog.wolfram.com

21–30 of 113 posts

Re: All Rational Approximations of Pi Are Useless

#21
post #16

Very neat: naive attempts to memorize Pi with rational-number shortcuts (i.e., fractions with integers in the nominator and denominator, such as 22/7 and 355/113) seem pointless, because getting more decimal digits of Pi right requires that one memorize a correspondingly larger number of digits in the numerator and/or denominator, defeating the purpose of these native attempts. -- PS. The author is offering a prize t…

Rational approximations are good for finding reasonable answers without a calculator. My contrived example is the area of a circle, r=7. i can do 22 * 7 in my head and get 154, which is pretty darn close to 153.86. 7 is awkward (for me anyway) but it does offer opportunities to cancel.

Re: All Rational Approximations of Pi Are Useless

#22
I don't like how he's measuring accuracy, here. Something that produces (3.149) is treated as closer than (3.139).

22/7 looks marginally better, if we compare actual error. It's the same number of characters as 3.14, but about 20% less error. 355/113, meanwhile, is not only better than 3.14159 (same number of characters) but actually even better than 3.141592 (about 60% less error).

It's also easier to remember, due to the repeated digits.

Re: All Rational Approximations of Pi Are Useless

#23
post #10

I think blog.wolfram.com is probably the best company blog I've seen, from a marketing perspective. A large number of the entries are basically of the form "Here is an interesting problem, and here's how I solved it with Wolfram products". They generally let the problem have the spotlight rather than focus on the Wolfram products, so it doesn't feel like you are getting pitched. Here's a related problem, but for e: u…

This has been Wolfram's strategy since the beginning. They have their own journal, books, user groups, all showing how to solve problems with mathematica.

Re: All Rational Approximations of Pi Are Useless

#24
post #14

Earlier quoted context omitted.

I think the point is that McLoone is using two different notations and measuring an artifact of this. There's nothing special about base-10 denominators.

He's comparing apples to apples. Kolmogorov complexity for different ways to approximate п is more or less flat at bang for the buck.

Strictly speaking it is not Kolmogorov complexity (That has an upper bound, namely the constant size of a program that can output arbitrarily many digits of Pi.)

Re: All Rational Approximations of Pi Are Useless

#25
post #17

This seems slightly silly if one is allowed to use, as Ed Pegg suggested, log and square root. If log and square root are allowed, then the obvious solution is log(-1)/(sqrt(-1)*log(e)) which is accurate to an infinite number of digits.

e is not rational.

Re: All Rational Approximations of Pi Are Useless

#27
post #21
post #16

Very neat: naive attempts to memorize Pi with rational-number shortcuts (i.e., fractions with integers in the nominator and denominator, such as 22/7 and 355/113) seem pointless, because getting more decimal digits of Pi right requires that one memorize a correspondingly larger number of digits in the numerator and/or denominator, defeating the purpose of these native attempts. -- PS. The author is offering a prize t…

Rational approximations are good for finding reasonable answers without a calculator. My contrived example is the area of a circle, r=7. i can do 22 * 7 in my head and get 154, which is pretty darn close to 153.86. 7 is awkward (for me anyway) but it does offer opportunities to cancel.

How fast can you do 22 * 7 in your head? I get a lot of mileage out of simply approximating pi=3, and optionally adding in a factor of 10% later. For your example, I know 7^2=49 immediately, which I round to 50, 50 * 3=150 which is fairly close to 153.938. (Use more digits of pi!) I can quickly improve my estimate by adding 4.9. (Edit: It's also fairly trivial to get even better estimates quickly from here, but at this point it's probably faster to grab a cell phone / [favorite language] repl. From 154.9, subtract the additional 3 gained from using 50 instead of 49, now 151.9, add 4.9/2~=2.4, now 154.3, subtract 4.9 * 10% ~= .5, 153.8.)

Re: All Rational Approximations of Pi Are Useless

#29
There are other reasons, though, that a rational approximation can be useful. If you're doing mental arithmetic, for example, multiplying by a fraction can be easier than multiplying by a decimal, but this depends on the specific numerator and denominator. In this way, 22/7 fails horribly, because multiplying by 22 and dividing by 7 are not particularly easy operations.

For example, 100/32 is a less accurate representation than 22/7, but it is far easier to multiply, since you can do so with only two mental registers. In fact it also takes fewer registers to multiply than 3.1 (which is also less accurate than 100/32). However, it does require more mental operations than 3.1; 100/32 takes five halvings and a decimal shift, while 3.1 requires multiplication-by-3, a decimal shift, and an addition.

What would be really cool would be an analysis similar to the one in the article that used a model of mental computation to find the best tradeoff for working numbers in your head.

That said, for mental calculations you're probably better off just pretending that pi = 3, unless you're just trying to impress someone.

Re: All Rational Approximations of Pi Are Useless

#30
post #25
post #17

This seems slightly silly if one is allowed to use, as Ed Pegg suggested, log and square root. If log and square root are allowed, then the obvious solution is log(-1)/(sqrt(-1)*log(e)) which is accurate to an infinite number of digits.

e is not rational.

ln(-1)/sqrt(-1)
Post reply on HN