All Rational Approximations of Pi Are Useless
blog.wolfram.com
blog.wolfram.com
Here's a related problem, but for e: using each digit 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 at most once each, and only the operators +, -, x, /, and ^ (exponentiation), and parenthesis for grouping, how close can you get to e? Digits may not be concatenated--for instance, you cannot get a 23 by simply placing the 2 next to the 3.
My best, after about 15 minutes of fiddling, were:
(3x(4x7+1))/2^5 = 2.71875 ≈ e + 0.000468172
and 2x(9x6-1)/(3x(8+5)) = 2.717948... ≈ e - 0.000333111
but it turns out you can do FAR better.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.
Best I've seen is given in this discussion: http://www.reddit.com/r/math/comments/zakqh/using_the_number...
Interesting problem nonetheless.
short: 2981^ (1/8)
less short: (2574 + 4903 ^ (1/4))/950
I used: http://apod.nasa.gov/htmltest/gifcity/e.1milPerhaps I am misunderstanding your output but it is only correct up on till: 2.7182818
I think that renders both of your solutions invalid, but cool nonetheless!
(1+9^(-4^(7x6))^(3^(2^85))
which gives e to 18457734525360901453873570 decimal digits. (9 - (5/7)^(1/2)) / 3
I was tired when I saw that post, it was late/early. rmccue, I also seemed to have missed that you gave an error bound =(<span style="FILTER: FlipH;">9</span>
However I think for this problem, and many others, mastering a general purpose programming language is much more efficient. After all you can pipeline symbolic expressions to Mathematica - or Maple >:) - and you have the best of both worlds. Or you just use Ruby or another highly expressive language - the syntax of simple symbolic expressions is basically the same.
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.
(http://www.patrickcraig.co.uk/other/compression.htm)
This page has some nice compression gimmicks (a file that compresses well with one algorithm but hardly at all with another; a file that uncompresses to itself)
(http://www.maximumcompression.com/compression_fun.php)
The large text compression benchmark has some nice finely tuned compression software and statistics.
(http://mattmahoney.net/dc/text.html)
And the Hutter prize is interesting. (Get the 100 Mb file of enwiki8 and the de-compressor to under 16 Mb)
But it is acceptable to talk about compression in terms of Kolmogorov Complexity - roughly, if the shortest program which outputs a particular string is shorter than the length of the string then we have compression. Of course one can also show that KC does not compress most strings by much.
But KC is more interesting than say an entropy coding algorithm for infinite (or big finite) strings which possess a lot of structure, PI say (which by the way is by definition not a random string). The expressed program will be far smaller by far, yielding an impressive compression of the sequence.
I think you mixed up lengths and number of values here. With 2^N - 1 it is the latter.
> Of course one can also show that KC does not compress most strings by much.
The problem of finding the Kolmogorov complexity of a string is undecidable, so I wonder if this statement is true.
Otherwise, it is a (very useful) abstraction. It isn't compression, it is a technique for avoiding expansion in cases where an expanded form is never needed.
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.
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.
It seems that what's special about rationals with power-of-10 (with power > 1) denominators is that we have a readily available shorthand, uh notation, for them.
Notation can be very significant. The transition from Roman numberals to positional notation with 0 took a thousand or so years. But boy did it ever make long division easier!
--
PS. The author is offering a prize to the reader who finds the rational number which gets the most decimals of Pi right for every digit of such rational number that has to be memorized. (Note that only rational numbers are allowed -- that is, fractions with integers in the numerator and denominator. Using formulas or numbers that are not rational is not allowed in the competition.)
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 calculation, spending 3 seconds to re-derive the sequence seems tolerable.
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.
Repeat the digits
Use odd digits
Use increasing sequence
Use three digits
Split the result in half and divide
Pi is greater than 1
But since humans have associative memory, these are easier to learn than a seemingly arbitrary digits sequence.
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.
You're better off not adding anything. If you could add 5% instead, then you'd be much better still.
However, you could work from the 3 you've already used as the tripling in your model, then take 10% of that then 1/2 of that to get there. I've just never done it that way (these are things I just do without thinking too deeply about).
My remark was only in the context of the present conversation, where Pi is representable by the ratios of various integers.
I used a lot of slide rules during my years as a NASA engineer, but none of those I owned had marks for physical constants -- too bad, because it's a very good idea.
3.141592652 vs pi ~= 3.141592653
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.
1. As soon as you allow square roots, you allow irrational numbers. (This sqrt(2).)
2. "The natural log - ln - is not rational" is a different statement than "e is irrational". A rational function is one that can be written as the ratio of two polynomials.
log(-1)/(sqrt(-1)*log(e)) = ln(-1)/sqrt(-1)
I am just writing the same equation using a log with another base so I don't have e in the equation explicitly.
So I don't really understand what your point is.
Once you allow sqrt and ln (or sqrt, log, and e) the problem is silly. He explicitly allows, see the bottom of the article, sqrt, log, and irrational numbers.
Once he introduces the square root he introduces imaginary numbers, sqrt(-1), and transcendental numbers, for example the Gelfond–Schneider constant 2^sqrt(2).
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.
Any idea how this is implemented in mathematica?
[1](http://tauday.com/tau-manifesto)
(And if you really really really care, you use a different font then the one HN defaults too.)
Basically, it tries to see if mathematical equations have meaning by determining how well they "compress" the results. For instance, the author says the equation eπ−π=19.9990999... is compressible (the equation generates more bits of π than it takes up itself), and thus it is likely that there is some mathematical reason for this -- it's not just a coincident. On the other hand, 314100 gives an approximation to π but does not compress its representation, so there is nothing intriguing about this formula.
I believe Colin [EDIT: I meant Jon McLoone, the author of the article. Sorry Colin!] is counting only full digit matches. It is this metric that is useless.
If so, perhaps you can explain why people do that so often. I see it quite frequently, and am baffled by it.
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.
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.
22/7 is the worse. Too much trouble for too little benefit
If you need the value of pi to do a hand calculation, 3.14 is more than enough
And if you need to "produce" pi just remember pi/4 = 1 - 1/3 + 1/5 - 1/7... (there are formulas that are better, sure, but less memorizable)
This converges too slowly to be practically useful.
If you group the consecutive terms in pairs you get that the nth pair sums to 1/(2n + 1) - 1/(2n + 3) = (2n+3 - (2n+1))/(2n+1)(2n+3) = 2/(2n+1)(2n+3) = Theta(1/n^2). Thus it has the same asymptotic growth order as sum 1/n^2. That has has monotone terms and so it's easy to estimate how many terms we need to get k correct fractional digits by solving 10^(-k) = 1/n^2, giving n = 10^(k/2).
This is off by a big constant factor but it gives you the right idea that you need an exponential number of terms relative to the desired number of significant digits. From Wikipedia: "After 500,000 terms, it produces only five correct decimal digits of pi."
So, this series for pi has only theoretical relevance.
Another classic is the old hard science error analysis. Lets say you're squaring the radius and multiplying by pi, turns out you need to measure the radius much more accurately than you measure pi, so pi=4 might not be the limiting factor if R is a 8 bit A/D converter and you're not taking full advantage of the entire 8 bit range (so its really a 4 bit a/d or whatever)
Another is systemic effects. Some weird hydraulic PLC thing I was messing with probably 20 years ago basically needed the ratios of areas of circles, and it turns out that any approximation of pi divided by itself always equals 1. The puzzler is for diagnostic purposes they used pi=4 so the numbers kinda made sense in the debugger before the ratio was calculated. I must have thought about that 4 for an hour trying to reverse engineer what they were trying to do before I realized that "4" was their pi approximation and it didn't matter anyway.
So to scale by pi, we multiply by 355, then divide by 113.
Can't be too careful -- some breathtakingly literal-minded soul might submit π as a candidate for π.
Admittedly, that's a pretty niche use, but a use, nonetheless.