Live data from Hacker News

All Rational Approximations of Pi Are Useless

blog.wolfram.com

91–100 of 113 posts

Re: All Rational Approximations of Pi Are Useless

#91
post #15

What if you are on embedded hardware and/or can't use floats for some reason?

If we're on embedded hardware, or can't use floats for some reason, we use 22/7. It's called fixed point arithmetic. Most CPUs have an integer instruction that multiplies into a double-precision integer result, and an instruction that takes a double-precision integer dividend. So to scale by pi, we multiply by 355, then divide by 113.

Is that any better than just multiplying by pi * 2^n and then shifting right by n?

Re: All Rational Approximations of Pi Are Useless

#92
post #33
post #31

Earlier quoted context omitted.

((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...

[deleted]

Re: All Rational Approximations of Pi Are Useless

#93
post #77
post #18

Earlier quoted context omitted.

I might be different, but 355/113 is very easy to remember and is not 7 unique segments of information. I just think "double the odds" 113355 We know we want a fraction, not a single number, so split down the middle: 113/355 And we know pi won't be less than 1, so flip it: 355/113. Knowing that the digits sequences are doubled lets you do some cheap, mental run length encoding. In a case where you need a hand calcula…

Unwillingly, I just memorized a Pi approximation.

As did I.

I came back here 6 hours after reading it to confirm that it is still stuck in my brain, I am guessing permanently. Although I already knew Pi to 6 decimal places so its not like I am gaining a lot of accuracy out of this.

Re: All Rational Approximations of Pi Are Useless

#94
Some people really like their 22/7: http://www.psychologytoday.com/blog/freedom-learn/201003/whe...

Though come think of it, is this a thing particular to US education? I don't remember ever encountering this in elementary school. I think the early math lessons were just set up never to require irrational numbers, and from 7th grade on (this was somewhere around 1993) we used calculators which gave us PI and trigonometric functions.

Re: All Rational Approximations of Pi Are Useless

#95
post #79

Earlier quoted context omitted.

FlipH is not a legal operator.

No idea what you're talking about. I'm merely improving the typography.

From the original spec of the problem: "only the operators +, -, x, /, and ^ (exponentiation), and parenthesis for grouping"

Re: All Rational Approximations of Pi Are Useless

#96
post #90

Setting MaxExtraPrecision to "to use as much automation as it needs to resolve numerical values" looks very interesting. It seems like it is being lazy, because the amount of precision needed isn't known until after the result is used (in this case the function that counts number of correct digits). Any idea how this is implemented in mathematica?

I don't know about mathematica specificly, but the standard way is lazily, as you say. You pass around a lazy list of digits (i.e. a partial list and a function that knows how to compute the next digit and the next function); it's trivial to add or subtract two such things, multiplication and division are harder but not too bad, and once you've got the idea square root and other more complex operations are pretty straightforward.

Re: All Rational Approximations of Pi Are Useless

#97
Sorry to nag but the 'goodness' of 22/7 is due to the size of the denominator, not to the number of digits you have to memorize (actually 2, not 3, but anyway). You get less than a .001 relative error with a denominator less than 10, that is why it is a good approximation: nothing to do with memory.

The thing is: as pi is transcendental, there are very very good rational approximations in that sense (this is an old theorem due to Liouville): http://mathworld.wolfram.com/LiouvillesApproximationTheorem...., there is no 'memorizing' going on there.

Re: All Rational Approximations of Pi Are Useless

#98
post #20

Earlier quoted context omitted.

No it isn't. It isn't "a shorthand". It is a notation. Of those two notations, no one is "a shorthand" of another.

Still, it is a rational approximation of pi.

Yes, isn't saying that rational approximations of pi are useless the same as saying that all approximations of pi are useless? Or is there some meaningful irrational approximation of pi that can be made?

Re: All Rational Approximations of Pi Are Useless

#99

Sorry to nag but the 'goodness' of 22/7 is due to the size of the denominator, not to the number of digits you have to memorize (actually 2, not 3, but anyway). You get less than a .001 relative error with a denominator less than 10, that is why it is a good approximation: nothing to do with memory. The thing is: as pi is transcendental, there are very very good rational approximations in that sense (this is an old t…

> The thing is: as pi is transcendental, there are very very good rational approximations in that sense (this is an old theorem due to Liouville) ...

Expressed another way, for every estimate of Pi's value, however large, there are two integers that, expressed as a ratio, will produce the same result.

Re: All Rational Approximations of Pi Are Useless

#100
post #99

Sorry to nag but the 'goodness' of 22/7 is due to the size of the denominator, not to the number of digits you have to memorize (actually 2, not 3, but anyway). You get less than a .001 relative error with a denominator less than 10, that is why it is a good approximation: nothing to do with memory. The thing is: as pi is transcendental, there are very very good rational approximations in that sense (this is an old t…

> The thing is: as pi is transcendental, there are very very good rational approximations in that sense (this is an old theorem due to Liouville) ... Expressed another way, for every estimate of Pi's value, however large, there are two integers that, expressed as a ratio, will produce the same result.

No, no, not at all: the meaning of the theorem is that there are amazingly accurate approximations for small sized denominators, that is.
Post reply on HN