Live data from Hacker News

All Rational Approximations of Pi Are Useless

blog.wolfram.com

31–40 of 113 posts

Re: All Rational Approximations of Pi Are Useless

#31
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…

((8^(5/4))^(((2/(0-(7+1)))^9)^(3-6))) = 2.718281848685499 ~ e +/- 2.0226453845140213e-08

That was fun. Although I'm having trouble confirming the answer... - Also I'm meant to be packing.

http://play.golang.org/p/G_Y5SblSuv for some brute force eval :)

Edit: This could be a nice demonstration for a genetic algorithm: A clearly defined fitness function yet an unknown (unknowable?) goal, and a distinct representation of the genes. I'm not sure how hereditary the fitness is though.

Further edit: Just 4 digits: (6-(8^(4/7))) 2.718658575969448 0.00037674751040306376 - I hope this is a) correct, b) interesting to someone else.

Re: All Rational Approximations of Pi Are Useless

#33
post #31
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…

((8^(5/4))^(((2/(0-(7+1)))^9)^(3-6))) = 2.718281848685499 ~ e +/- 2.0226453845140213e-08 That was fun. Although I'm having trouble confirming the answer... - Also I'm meant to be packing. http://play.golang.org/p/G_Y5SblSuv for some brute force eval :) Edit: This could be a nice demonstration for a genetic algorithm: A clearly defined fitness function yet an unknown (unknowable?) goal, and a distinct representation o…

You beat me by about 5 orders of magnitude, but it is possible to do better, by another 200000 orders of magnitude or so! :-)

Best I've seen is given in this discussion: http://www.reddit.com/r/math/comments/zakqh/using_the_number...

Re: All Rational Approximations of Pi Are Useless

#34
post #30
post #25

Earlier quoted context omitted.

e is not rational.

ln(-1)/sqrt(-1)

The natural log - ln - is not rational, as it is the logarithm with base e. That is, ln(x) answers the question, to what power would we have to raise e in order for it to equal x?

Re: All Rational Approximations of Pi Are Useless

#36
post #30
post #25

Earlier quoted context omitted.

e is not rational.

ln(-1)/sqrt(-1)

Maybe you're just trolling, but rational numbers are numbers that can be expressed as p/q, where p and q are integers. Neither i e nor i is an integer, so your proposed quotient has no bearing on the (ir)rationality of e.

Re: All Rational Approximations of Pi Are Useless

#38
This is expected behavior. The best fractions are tied to the http://en.wikipedia.org/wiki/Continued_fraction representation of pi. The ones which have a chance of giving you several "free" digits are going to be tied to large terms in the representation. Glancing at http://oeis.org/A001203/b001203.txt gives you a sense that large terms are kind of rare. http://mathworld.wolfram.com/Gauss-KuzminDistribution.html quantifies how rare they are.

Incidentally if you're looking for a good fractional approximation to pi and e you'll have a lot of work, but for sqrt(2) it is easy because the continued fraction representation is 1 followed by 2, 2, 2, .... Thus sqrt(2) is 1 + 1/(2 + 1/(2 + 1/(2 + ...))). Very easy pattern to remember, and can give a rational approximation as precise as you possibly want.

Re: All Rational Approximations of Pi Are Useless

#40
post #27
post #21

Earlier quoted context omitted.

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 th…

22 times a single digit is pretty easy, double the digit, shift the decimal, add the doubled number - but it's not trivial. As i said, a contrived example.

The point is, you yourself stick to integer arithmetic, then try to fix it up with a 10% modifier at the end. People have been using pi for a long time. Easy access to calculators is, what, about 50 years now? I'll happily agree that rational representation is a historical artifact. But i still believe the vast majority of people doing arithmetic pre 1960 with floating point numbers did it like you and i do. They would put off the decimal representation as long as possible.

Post reply on HN