How many decimals of pi do we need? (2016)
jpl.nasa.gov
jpl.nasa.gov
> 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!
- 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 powerYeah, 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.
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.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.
Therefore double precision, which accepts values even over 10^300, is good enough to store any values measured with natural units, while single precision (range only up to around 10^38) would be overflown by many values measured with natural units, and overflow would be even more likely in intermediate values of computations, e.g. products or ratios.
For those not familiar with the term, a system of natural units for the physical quantities is one that attempts to eliminate as many as possible of the so-called universal constants, which appear in the relationships between the physical quantities only as a consequence of choosing arbitrary units to measure some of them.
While the Planck units form one of the most notorious systems of natural units, the Planck units are the worst imaginable system of units and they will never be useful for anything. The reason is that the Newtonian constant of gravity can be measured only with an extremely poor uncertainty in comparison with any other kind of precise measurement.
Because of that, if the Newtonian constant of gravity is forced to have the exact value 1, as it is done in the system of Planck units, then the uncertainty of its measurement becomes an absolute uncertainty of all other measured values, for any physical quantities.
The result is that when the Planck units are used, the only precise values are the ratios of values of the same physical quantity, e.g. the ratio between the lengths of 2 objects, but the absolute values of any physical quantity, e.g. the length of an object, have an unacceptably high uncertainty.
There are many other possible choices that lead to natural systems of units, which, unlike the Planck units, can simplify symbolic theoretical work or improve the accuracy of numeric simulations, but the International System of Units is too entrenched to be replaced in most applications.
All the good choices for natural units have 2 remaining "universal constants", which must be measured experimentally. One such "universal constant" must describe the strength of the gravitational interaction, i.e. it must be either the Newtonian constant of gravity, or another constant equivalent to it.
The second "universal constant" must describe the strength of the electromagnetic interaction. There are many possible choices for that "universal constant", depending on which relationships from electromagnetism are desired to not contain any constant. The possible choices are partitioned in 2 groups, in one group the velocity of light in vacuum is chosen to be exactly one (or another constant related to the velocity of light is defined to be 1), which results in a natural system of units more similar to the International System of units, while in the second group of choices some constant related to the Coulomb electrostatic constant is chosen to be exactly 1, in which case the velocity of light in vacuum becomes an experimentally measured constant that describes the strength of the electromagnetic interaction (and the unit of velocity is e.g. the speed of an electron in the fundamental state of a hydrogenoid atom).
I have experimented with several systems of natural units and, in my opinion, the best for practical applications, i.e. which lead to the simplest formulas for the more important physical relationships, are those in which the Coulomb law does not include "universal constants" and the speed of light is a constant measured experimentally, i.e. the opposite choice to the choice made in the International System of Units.
The Planck units are always suggested only by people who have never tried to use them.
The choice from the International System of Units, to have the speed of light as a defined constant while many other "universal constants" must be measured, was not determined by any reasons having anything to do with what is more appropriate for modern technology.
This choice is a consequence of a controversy from the 19th century, between physicists who supported the use of the so called "electrostatic units" and the physicists who supported the use of the so called "electromagnetic units". Eventually the latter prevailed (which caused the ampere to be a base unit in the older versions of the SI, instead of the coulomb), because with the technology of the 19th century it was easier to compare a weight with the force between 2 conductors passing a fixed current than to compare a weight with the force between 2 conductors carrying a fixed electrical charge. There is a long history about how SI evolved during the last century, but the original choice of the "electromagnetic units" instead of the "electrostatic units" made SI more compatible with the later successive changes in the meter definition, which eventually resulted in the speed of light being a defined constant, not a measured constant.
Nowadays that does not matter any more, but few people remember how the current system has been established and most who have grown learning the International System of Units have the wrong impression that having an exact value for the speed of light is somehow more "natural" than having for it an experimentally measured value.
The truth is that there are many systems of natural units, and each of them is exactly as natural as any other of them, because all have a single experimentally measured electromagnetic constant. When the velocity of light is removed from some equations, an equivalent "universal constant" is introduced in other equations, so which choice is best depends on which equations are more frequently used in applications.
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.
I give you the 10^100th digit of the above algorithm and you give me the 10^100th digit of pi.
Whoever fails owes the other side 10 BTC.
Describe the n-th digit of an irrational number without calculating all previous positions of the number.
If pi were a sequence of digits, there is no algorithm to calculate it other than by calculating pi but there is one for op's number. The very fact that he could show the algorithm for creating the sequence of numbers in his post is indicative of that.
For pi such an algorithm doesn't exist (other than calculating pi itself).
I wanted to emphasize this by talking about the "sequence of digits" in my original reply but apparently I failed at explaining this well.
Maybe I should rephrase it:
My assumption is: If there is an O(1) algorithm to determine the n-th digit of an irrational number x then the number is still "of a different class" than the likes of pi and there OP might not be able to induce things from this "lesser class of irrational numbers"
However, it's just an intuition
Actually, there is: https://math.hmc.edu/funfacts/finding-the-n-th-digit-of-pi/
I'd rather say it contains the code to generate itself which should be much easier (= earlier) to find.
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.
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.</>
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.
This is also unrelated to NASA’s past or present activities
If a HN user requires more, as for example they are planning to travel further than Voyager 1 then you’re absolutely right, it’s not very convincing to narrow it down same as NASA had.
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!".
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).
How 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)
How many articles on how many decimals of pi do we really need do we really need?
> 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
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%.
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.
> "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..."
I guess you can get to "i" via algebraic equations, but linking it to a rotation unit outside a flat space seems tricky.
And you don't need proper calculus for the circumference, just the idea of limits.
From 1997 until 2000, Intel has introduced each year some instruction set features aimed at replacing the 8087 80-bit ISA and this process was completed at the end of 2000, with the introduction of Pentium 4.
Since the end of 2000, more than 21 years ago, the use of the 80-bit floating-point numbers has been deprecated for all Intel CPUs (and since 2003, also for the AMD CPUs).
The modern Intel and AMD CPUs still implement the 8087 ISA, only for compatibility with the old programs written before 2000, but they make no effort to make them run with a performance similar to that obtained when using modern instruction sets, like AVX-512 or AVX.
If there are modern compilers which in 2022 still emit 8087 instructions to handle values declared as "long double" (unless specifically targeted to a pre-2000 32-bit CPU, e.g. Pentium Pro), I consider that as a serious bug.
A compiler should either implement "long double" as the same as "double", which is allowed, but lazy and ugly, or it should implement the "long double" operations by calls to functions from a library implementing operations with either double-double or quadruple precision numbers, exactly how many compilers implement operations with 128-bit integers on all CPUs or with 64-bit integers on 32-bit CPUs.
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.
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
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.
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.
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.
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)
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...
It is probably ok for estimating how many pavers you need around a circle garden bed.
(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.