13 ms·
How many decimals of pi do we need? (2016)
- bombcar 4y ago“All of them! Bring me the last digit of pi,” said Canute.
- formerkrogemp 4y agoA ship was lost at sea. The people were angry, so the monarch sentenced the sea to fifty lashes and stoning for the sailors lost at sea. The Monarch's guard applied the lashes, and the people stoned the sea. The people were appeased to the last.
- signa11 4y agoactually, i can get 10 people, and among them pretty much guarantee you that one of them will be correct.
- bradleyjg 4y agoNo, they’d all be wrong. The correct answer is there is no last digit.
- charcircuit 4y agoWe have a digit extraction algorithm to calculate any digit of pi. You need to specify which digit since there isn't a last digit.
- morninglight 4y agoMr. Rayman naturally focuses on the astronomical use of pi. I wonder what considerations might apply to its use at the subatomic scale.
- Waterluvian 4y agoI immediately wondered this too. Other than seeing that two numbers are strictly equal when a computer evaluates them, how much precision do physicists and mathematicians actually need?
- Ishmaeli 4y agoThirty-five digits or so get us to the Planck length.
- cycomanic 4y agoIn my experience as a physicists many things are perfectly fine even with single precision. This is especially true if you're dealing with experiments, because other errors are typically much larger. 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.
- TheOtherHobbes 4y ago32-bit float in audio has a dynamic range of 1528dB. The loudest possible physical dynamic range is around 210db. So that's quite a bit of headroom. Real hardware audio converters max out around 22 bits of resolution, so for sampling the maximum dynamic range is 110dB to 120dB on super-spec top grade hardware. 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.
- kloch 4y agoIt depends on the dynamic range you are working with and they type of operation. Dynamic range is critical with addition and subtraction but usually not important with multiplication and division (where only maximum exponent ranges are of concern). 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)
- BMc2020 4y agoIf you read the novel Contact by Carl Sagan (it's not in the movie) you get to find out what secret is hiding in PI's digits.
- Tao3300 4y agohttps://xkcd.com/10 https://xkcd.com/10
- jonah 4y agoAlso reminds me of https://xkcd.com/2170/ https://xkcd.com/2170/
- nadavision 4y agoObligatory "there truly is an xkcd for everything."
- bumblebritches5 4y ago
- andreareina 4y agoThat ending filled me with such a feeling of wonder as a kid. Even now, and that's understanding the implication of pi very likely being normal.
- Scarblac 4y agoIf pi is normal, it contains all possible secrets encoded within it, right? Including copies of that book in various languages. It's Borges' library.
- 2-718-281-828 4y agoBut it also contains all possible contradictions and negations of all possible secrets - so, you don't know which is the "true" secret.
- 4y ago
- flatline 4y agoIsn’t that just what you get with double precision floats?
- hackernewds 4y agodouble precision float lens are related to the number of digits of pi that are relevant?
- xvedejas 4y agoWell kinda, the size of the mantissa is certainly chosen to be large enough to give the precision scientific computing would "typically" need, but that's considering trade-offs and just being vaguely good enough for most cases. Sometimes we use 80-bit extended precision floating point for example.
- andreareina 4y agoI thought 80-bit floats have been mostly deprecated due to getting different results depending on whether the compiler put the variables in main memory or not?
- adrian_b 4y ago80-bits have been deprecated because after Pentium Pro (end of 1995), the last Intel CPU in which the operations with 80-bit numbers have been improved, Intel has decided that the 8087 instruction set must be replaced (mainly because it used a single stack of registers, which is an organization incompatible with modern CPUs having multiple pipelined functional units, which need independent instructions, to be executed concurrently, while all instructions using the same stack are dependent) and that their future instruction set should not support more than double precision. 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.
- altitudinous 4y agoThis comes up often in various postings and forums, and I enjoy it every time I read it. I like the perspective.
- joshuamcginnis 4y agoIs there any relationship between pi and fractals?
- sillysaurusx 4y agoI’m pretty sure there’s a way to cram pi into basically any natural phenomenon, if you’re determined enough. Just ask the number theorists.
- Tao3300 4y agoI guess it depends on the fractal. By definition, the Mandelbrot set is contained within a circle. https://commons.wikimedia.org/wiki/File:Animation_of_the_growth_of_the_Mandelbrot_set_as_you_iterate_towards_infinity.gif https://commons.wikimedia.org/wiki/File:Animation_of_the_gro...
- swader999 4y agoSo my daughter didn't really need to memorize it to 80 digits I guess.
- quickthrower2 4y agoHandy for some rock paper scissors entropy
- koreanguy 4y ago
- anothernewdude 4y agoAre there no calculations that would compound this error though? Where you use multiple circles, or conversions and the errors would grow?
- kloch 4y agoRepeated summation can compound rounding errors and reduce the effective precision of floating point encoded numbers. 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 https://en.wikipedia.org/wiki/Kahan_summation_algorithm
- klodolph 4y agoYes, the error in floating point calculations compounds. However, you can figure out how fast it compounds, and there are different algorithms where it compounds at different rates. 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.
- mlyle 4y ago> Generally speaking, if you think you need more than double precision, what you really want is double precision and a better algorithm. Generally speaking. 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.
- Hayvok 4y agoSummarized answer from the article. > 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!
- anigbrowl 4y ago- 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 power
- louloulou 4y agoIt's a good metric to determine how advanced a civilization it. Would be cool to just compare pis with the aliens, and then whoever has the longest pi takes over, rather than fighting to extinction.
- dang 4y agoRelated: How Many Decimals of Pi Do We Really Need? - https://news.ycombinator.com/item?id=30023489 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 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 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 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 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 https://news.ycombinator.com/item?id=11315974 - March 2016 (1 comment)
- formerkrogemp 4y ago"Only sociopaths, engineers, and scientists use more than 4 digits of pi. Which one are you?"
- a9h74j 4y agoThe US supreme court has decided that individual states can again legislate pi == 3.
- raegis 4y agoI thought engineers use 22/7?
- quickthrower2 4y agoI hope not :-) It is probably ok for estimating how many pavers you need around a circle garden bed.
- euroderf 4y ago355/113 is easy to remember, and/but it's decimal. In hex it's 163/71, which is a lot less visually simple.
- frognumber 4y agoEngineers generally use pi=e=3. (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.
- bumblebritches5 4y ago
- thenoblesunfish 4y agoIt’s very interesting how effective double precision is for doing physical calculations. Higher precisions exist but almost all of the time the answer is not to use them, but to scale your equations differently.
- TowerTall 4y agoIf that's so, then why do we calculate pi with billions of decimals?
- alexb_ 4y agoWhy not?
- QuadrupleA 4y agoBecause we got nerd sniped ( https://xkcd.com/356/ https://xkcd.com/356/ ).
- quickthrower2 4y agoAcademic funding?
- egberts1 4y ago11 digits of PI will let you hit the electron of a hydrogen atom or land on Pluto.
- mukara 4y agoFor GPS, we use the government's recommendation of pi = 3.1415926535898 to compute satellite orbits...2 digits less than NASA's. Other constellations (Beidou, Galileo, etc.) follow GPS.
- cozzyd 4y agocrazy that I have more digits of pi memorized than that, to this day (so much wasted time in Middle school, I guess).
- photochemsyn 4y agoIf space can be curved, non-flat, then can't pi take on a wide variety of values, like near the high curvature of space near a black hole? As I suspected... > "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..." https://physics.illinois.edu/news/34508 https://physics.illinois.edu/news/34508
- anderskaseorg 4y agoπ is defined as the ratio between a circle’s circumference and diameter in ideal flat Euclidean space. You can measure circles in other spaces and get different numbers, but those numbers are not π. (That’s why your linked article writes π′ or “π” when referring to those numbers.)
- perilunar 4y agoPresumably you only need the same number of digits as you have for any other quantities you are using in your calculations. So... how accurately can they measure the position and velocities of the Voyagers or other spacecraft? Or the planets for that matter?
- MauranKilom 4y agoWell, not necessarily. It should definitely have more digits, otherwise you do amplify your errors. But it doesn't need that many more digits for that to become insignificant.
- jmfayard 4y agoThe Bible uses PI = 3 and that's good enough for me > 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
- jonatron 4y agoShould've been at 7:22 King James
- 8n4vidtmkvmk 4y agoyou mean 7:21 given the circumstances
- Timwi 4y agoLet's call it an even 7:20
- deleted 4y ago[deleted]
- midasuni 4y agoIt was round, was it a perfect circle? 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%.
- deleted 4y ago[deleted]
- quickthrower2 4y agoUnless nautical cubits are different from land based cubits
- frumiousirc 4y agoThey are wetter.
- ur-whale 4y agoMy bet would have been that they don't use it at all. 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.
- azeirah 4y agoI'm sure NASA uses sin and cos...
- lota-putty 4y agoHow many decimals do "we" need? Depends on the context and room for errors & consequences. Double Precision (15 digits) suffices in most cases.
- deleted 4y ago[deleted]
- haunter 4y ago355/113 is what I learned as a kid
- euroderf 4y agoand newsflash: it is "good enough" :-D
- s0teri0s 4y agoAll of them.
- jiggawatts 4y agoA couple of months ago I had a debate with someone on this forum.[1] He was saying that 128-bit floating point numbers were needed for chip design for the precision. 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. [1] https://news.ycombinator.com/item?id=31092448 https://news.ycombinator.com/item?id=31092448
- deleted 4y ago[deleted]
- thatjoeoverthr 4y agoThis reminds me of using Pi = 3. I remember a YouTuber using it in a calculation to antagonize the audience a little bit. The thing is, any number you can come up with to represent Pi, isn’t Pi. You have approximations which are accurate enough or not for the application in front of you. If you get correct conclusions with only one digit of Pi, then 3 is a sufficiently accurate approximation for what you’re up to. But someone else might need fifteen digits…