203 points · by Abishek_Muthian · 4y ago · 168 comments
> For JPL's highest accuracy calculations, which are for interplanetary navigation, we use 3.141592653589793
> by cutting pi off at the 15th decimal point… our calculated circumference of the 25 billion mile diameter circle would be wrong by 1.5 inches.
The author also has a fun explanation that you don’t need many more digits to reduce the error to the width of a hydrogen atom… at the scale of the visible universe!
Yeah, yeah, go ahead and downvote this one to death. I know we don't like jokes 'round these parts, especially low-effort immature ones. :~(
However I doubt that a civilization that has survived long enough to invent some (local) sort successful space travel would budge.
There are two extremes that would bring balance: mutually assured destruction (but the power comparison must allow for a delicate balance of terror to be believable on both sides); or a mutually beneficial alliance (which can work with a well-meaning advanced civ encountering a less progressed one - the “there there’re, little one” case).
That being said, I’m not convinced that searching for universal others isn’t a dead end. But even if it is, it sure can stretch our understanding a bit.
E.g. look at the Kardashev scale, with which we can sort of stretch imagination and think of Dysom spheres instead of solar panels.
I mean, even if we don’t find aliens, with a roadmap like Kardashev’s it won’t be (too) long before we become the aliens many of us hope for/aspire to.
That pi is 6 orders of magnitude more precise. The nice thing about having 6 and not just 1 or 2 (that would be sufficient) is that you don't have to worry too much about the exponential effect of compound error.
So really 15 decimal places is enough not to worry about pi not adding significant imprecision to your calculation, but not so ridiculous as to waste most of your time processing what is essentially random digits.
That it roughly corresponds to the precision of IEEE754 double precision floating-point numbers is probably no coincidence. This is maths that standard hardware can do really well. More than that requires software emulation (slow) or specialized hardware (expensive).
Probably not in most cases, but this isn't the sort of place we shout people down just for disagreeing. If you disagree with them, present your reasoning, and not just "they're NASA so they must be right!".
This is also unrelated to NASA’s past or present activities
You think the NASA JPL is mistaken about how accurate they need Pi to be?
In the case of this explanation by JPL, they are giving a very dumbed down explanation to visualize the extreme precision of floats to layperson. By necessity it is very incomplete and fails to transmit a deeper understanding to those of us that have an at least passing understanding of numerically analysis. For me that means I want to know more, as there is certainly important nuance missing, and I'd want to know more from the same experts at JPL exactly because I trust their expertise.
c in 2^64 = 1.625 × 10-11 m/s; width of a hydrogen atom: 2.50 ^10-11 m
Edit: that's not quite right, for a limited scale, fixed point will do, but if you need wider range than can be directly represented as fixed point, something has to give. Machine floats aren't pretty things, we have to live with it.
Anything shorter than about 10^-43 sec is faster than light can travel a Planck length.
If you meant that 64bit long is a rather large 20decimals, indeed it is.
As a contrived example, consider the pattern:
01 001 0001 00001 etc.
This pattern is infinite and never repeats but we will never see two consecutive "1"s next to each other.
For your example there is an algorithm to describe the sequence of digits and for Pi there isn't.
EDIT + Clarification: There is an algorithm to calculate the digits of your number without calculating all previous digits. But for pi there isn't.
Either way, your proposition works for "the list (or concatenation) of all positive integers in ascending order" as well. There is no deep insight in it, even if it were also true for pi.
I'd rather say it contains the code to generate itself which should be much easier (= earlier) to find.
It is an infinite number where every possible sequence of digits is present, and therefore, such a number contains the code of a self aware program, as well as the complete description of our own universe (hence the name "universe number") and even the simulation that runs it, if such things exist.
We don't know if pi is a disjunctive number, for what we know, though unlikely, the decimal representation of pi may only have a finite number of zeroes. It means we don't have the answer to your question.
How many more, though?
<Perfectionist>1.5in of error per few billion miles seems a bit sloppy, even though I'm sure it fits JPLs objectives just fine.</>
JPL uses imperial units?
It’s an education article, and the author mentions he first got the question from (presumably American) students so it makes sense he would answer in imperial units that an American middle schooler could understand.
> It’s an education article
Then it should use the actual units that the students will use for engineering and scientific calculations. Saying "it's education" is not an excuse to not teach. - hey space nerds, check out my new result
- oh yeah what ya got math kid
- new digits of Pi. Such fast, very precision!
- not this shit again
- it's so cool, *look at it*
- tl;dr
- but it's the key to the universe
- ok ok, look we have to do actual space stuff
- laugh now fools, while I grasp ultimate powerHow Many Decimals of Pi Do We Really Need? - https://news.ycombinator.com/item?id=30023489 - Jan 2022 (10 comments)
How Many Decimals of Pi Do We Really Need? (2016) - https://news.ycombinator.com/item?id=24616797 - Sept 2020 (147 comments)
How Many Decimals of Pi Do We Need? - https://news.ycombinator.com/item?id=24267042 - Aug 2020 (2 comments)
How Many Decimals of Pi Do We Really Need? (2016) - https://news.ycombinator.com/item?id=15801317 - Nov 2017 (3 comments)
How Many Decimals of Pi Do We Really Need? - https://news.ycombinator.com/item?id=11316401 - March 2016 (120 comments)
How Many Decimals of Pi Do We Really Need? - https://news.ycombinator.com/item?id=11315974 - March 2016 (1 comment)
> And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about.
1 Kings 7:23 King James
In the original Hebrew version of I Kings, in that verse the word for 'circumference' is traditionally written differently to how it is read (there are instances of this kind of thing all over the Bible [1])
Each letter in Hebrew has a numeric value [2].
As written: קוה = 111
As read: קו = 106
Ratio between them: 111/106 = 1.04717...
Which is exactly the ratio between the reported value of pi (3) and the real value to 4 decimal places (3.1415)
So maybe they did have a better idea than "3". The 3 in the verse is to keep it simple, but there's a clue there for those who want the real number.
How many significant figures was it to? How accurate was construction and measuring techniques? 9.7 diameter would be reasonable as “10”, as would 30.47 being “30”, with values being well within 5%.
> "Now, some fun facts: for a circle of radius 1000 miles, the value of "π" would be around 3.10867! For a 50 mile radius, "π" would be 3.14151. And even the engineers who built the Large Hadron Collider should have worried about the value of "π", since for a circular structure 2.7 miles in radius (which is the case for the LHC) "π" would be 3.141592415! So, we strongly encourage all high energy physicists and their sympathizers to celebrate Pi Day two minutes earlier than the rest of the world to honor our non-Euclidean geometry! As for the community of general relativity... we encourage them to redo all the calculations in a non-minkowskian metric for a non-massless Earth to know exactly when they should celebrate Pi Day. Also, advocates of the Indiana Pi Bill who root for legally making π equal to 3.2 should probably reconsider and change it to a value smaller than 3.1415926, since no circle on Earth would give them their desired result! Though if the surface of our planet was a saddle, that would be a completely different matter..."
Paradoxically, double floats are engineered to provide more digits than you need because you need more digits than you need when engineering because if you don’t have insignificant digits to drop, you don’t have enough digits.
Now that's definitely a mild brain-teaser
The "default" number of digits was chosen and became the default because it's enough for mostly everything.
Generally speaking, if you think you need more than double precision, what you really want is double precision and a better algorithm. Generally speaking.
Keep in mind that all of your actual measurements are going to be way less precise than double precision. Tools like LIGO can measure differences to better than double precision (1 part in 10^21, or something like that), but they're not actually making any measurements to that kind of precision, they're just measuring changes of that magnitude.
Though a lot of the time, the better algorithm is using an error accumulator-- so 2 doubles. This tends to outperform 80-bit extended precision, double-double, or long double arithmetic... but more precision would often also suffice and use the same amount of space.
For example, if you are summing numbers, you can divide the numbers in half and recursively sum each half. This is superior, in terms of error, to a simple loop. If you are solving linear equations, you can calculate a matrix inverse—but this is awful in terms of error. Better idea is to use Gauss-Jordan elimination and back substitution. Better yet, use a pivoting. Better yet, factorize the matrix. Etc.
Doubles have ~16 decimal digits of precision but adding a billion doubles together sequentially (simple summation) could with worst case data reduce your effective precision to only ~7 digits. Random data would tend to have a sqrt(n) effect which would leave you with ~11 digits.
Several algorithms have been devised to reduce or even eliminate this effect. Kahan summation for example typically results in the precision loss of a single addition, effectively eliminating the compound errors. https://en.wikipedia.org/wiki/Kahan_summation_algorithm
OK, so simulate the 10^30 atoms in my table, give me their spatio-temporal evolution in structure under gravity, etc. etc. How much preicision in pi do you need, when you are compounding interactions of 10^30 atoms each tick? Basically infinite.
I wonder what considerations might apply to its use at the subatomic scale.
For example, 1.0 + 1.616e-35 = 1.0 (exact) with double precision as the dynamic range is far too high to encode the sum within the ~16 decimal digits available. The second term just gets rounded out.
1.0 / 1.616e-35 however can be successfully encoded and you will not lose much precision, at most a rounding error in the last digit.
So, to answer your question double precision is usually sufficient even at Planck scale as long as you are not also adding/subtracting terms at much larger scales (like the 1 meter example above)
To give you an example from my line of work (optical communication). We use high speed ADCs and DACs which have effective number of bits of around 5. While you can't do DSP with 6bit resolution, anything above 12 bits is indistinguishable. This is in fact used by the people designing the circuits for the DSP used in real systems. They are based on fixed point calculations and run on around 9 bits or so.
While other fields might have higher precision needs just remember that when you interact with the real world, your ADCs will likely not have more that 16bit resolution (even if very slow), so you're unlikely to need many more bits than this.
Of course for synthesis you can use the entire dynamic range. But you can't listen to it, because the hardware to play the full resolution doesn't exist. (For 32-bit float it's physically unbuildable.)
64-bit floats are still useful in DSP because there a few situations where errors recirculate and accumulate and 32-bit float is significantly worse for that than 64-bits. It doesn't take all that many round trips for the effects to become audible. Worst case is some DSP code can become unstable and blow up just from the numeric errors.
You could go up to 128-bit floats, but the benefits are basically zero.
First, because ... is there an actual circle anywhere in what they do?
Even ellipses are simplified approximate solutions to the N-body problem. Not to mention what happens when you apply a burn force.
Second because I would have imagined that most of what they do involves integrating PDE's where if, by chance, PI gets involved, it'll be implicitly computed by the integration engine.
But hey, happy to be proved wrong.
It took a bit of digging, but I eventually found a paper talking about fairly modern VLSI design being done with 32-bit floats, which aren't even as good as 32-bit integers, but apparently are nonetheless "more than good enough".
A lot of people are under the mistaken impression that twice as many digits is "twice as good", and so they have this mental model that 128-bit is "four times better than 32-bit".
In fact, it is 4,951,760,157,141,521,099,596,496,896 times as good for integers, and "merely" 618,970,019,642,690,137,449,562,112 times as good for floating point numbers.
So... how accurately can they measure the position and velocities of the Voyagers or other spacecraft? Or the planets for that matter?
Depends on the context and room for errors & consequences. Double Precision (15 digits) suffices in most cases.
https://commons.wikimedia.org/wiki/File:Animation_of_the_gro...
(Obviously not exclusively; there are times for more precision)
Four digits is almost always more than you need, though. If you need more, you probably:
- failed to make something balanced
- missed an opportunity to have something be self-calibrating
- used open-loop instead of a feedback system
- didn't taper a hole
- are measuring the wrong thing
- ... or similar.
It is probably ok for estimating how many pavers you need around a circle garden bed.