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.
All Rational Approximations of Pi Are Useless
91–100 of 113 posts
Re: All Rational Approximations of Pi Are Useless
#92Earlier 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...
Re: All Rational Approximations of Pi Are Useless
#93Earlier 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.
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
#94Though 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
#95Re: All Rational Approximations of Pi Are Useless
#96Setting 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?
Re: All Rational Approximations of Pi Are Useless
#97The 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
#98Earlier 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.
Re: All Rational Approximations of Pi Are Useless
#99Sorry 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…
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
#100Sorry 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.