14 ms·
How Many Decimals of Pi Do We Really Need? (2016)
- saagarjha 6y ago> Using pi rounded to the 15th decimal So, a 64-bit double, in other words.
- 082349872349872 6y agoachieved in 1424: https://news.ycombinator.com/item?id=23834687 https://news.ycombinator.com/item?id=23834687
- ggm 6y agoThe computed size (40 decimal digits) is .. less than the 128 bits of the IPv6 address. So, we can encode the radial accuracy of the universe, to the size of a hydrogen molecule in IPv6 packets
- 3pt14159 6y agoOpen to correction, but isn't 128 bits a little less than 40 decimal digits?
- prezjordan 6y ago3.4 x 10^38 So we'd be off by about <30 hydrogen atoms instead of <1 :)
- mixedmath 6y agoYes, just slightly. It would take 133 bits. So I suppose a packet would only hold the width of the universe up to an error of maybe the width of 32 hydrogen atoms. Clearly unacceptable. I'm sure this be fixed in IPv7.
- tinus_hn 6y agoAlso you’d need to account for the 3 to the left of the decimal point.
- neilwilson 6y agoThe next question is what is that IPv6 address? c90f:daa2:2168:c234:c4c6:628b:80dc:1cd1 I think
- segfaultbuserr 6y agoThere's no IPv7 beyond a proposal, but it was already fixed in IPv9 and deployed in production systems. RFC 1606 - A Historical Perspective On The Usage Of IP Version 9 https://tools.ietf.org/html/rfc1606 https://tools.ietf.org/html/rfc1606 > Whilst there are still many addresses unallocated the available space has been sharply decreased. The discovery of intelligent life on other solar systems with the parallel discovery of a faster-than-light transport stack is the main cause. This enables real time communication with them, and has made the allocation of world-size address spaces necessary, at the level 3 routing hierarchy. There is still only 1 global (spatial) level 2 galaxy wide network required for this galaxy, although the establishment of permanent space stations in deep space may start to exhaust this. This allows level 1 to be used for inter-galaxy routing. The most pressing problem now is the case of parallel universes. Of course there is the danger of assuming that there is no higher extrapolation than parallel universes...
- chmod775 6y agoThe highest number in base 2 you can cram in 40bits is roughly 0.34 * 10^39. I shifted it so the exponent is equal to the number of digits we can fit. 128 bits could indeed only fit the first 39 digits of PI. And even then you haven't really stored PI, because you haven't stored where the comma is supposed to go.
- sys_64738 6y agoWe used 22/7 when I was at school.
- werdnapk 6y agoThat's not going to get you very far if you're looking for precision.
- netmare 6y agoThere's always 355/113. It's roughly approximate to 6.6 digits† and strangely it's been easier for me to remember than 22/7. † https://www.johndcook.com/blog/2018/05/22/best-approximations-for-pi/ https://www.johndcook.com/blog/2018/05/22/best-approximation...
- tombert 6y agoI like these kinds of things, but a part of me has always wondered why people don't want to just memorize it to six digits at that point. I mean, how long does it really take you to memorize 3.1415926? Or you could do what I always did, much to the annoyance of my high-school and college physics teachers, and just write down all my answers in terms of pi and never bother reducing it, since I would always argue that I can keep it exact that way :)
- 082349872349872 6y agoalso useful for celebrating ∏ Day in europe, on a pre-kalend day in July.
- sys_64738 6y agoYep 14th March and 22nd July are both PI Days. Who knew? :)
- analog31 6y agoOn my best slide rule, it's visibly just a tiny bit to the right of 3.14, but I doubt that I could guess a fourth digit very well if a similar number emerged from a calculation.
- sam_lowry_ 6y agoWhy is the link having a hootsuite in it? Is it because it was posted by a marketeer?
- dvfjsdhgfv 6y agoI don't think the person posting it on HN did it on purpose as they didn't include it in their other submissions.
- totaldude87 6y agoJust seeing this, i really have no idea, just saw the site, copied url, submitted here, just like any other time!
- mdiesel 6y agoInteresting other take I've seen: The continued fraction of Pi is [3; 7, 15, 1, 292, ...] The 292 is a pretty big number, so at that point the fractional approximation is very good. 355/113 is good enough for anything you're doing on planet earth.
- lisper 6y agoJust for the record, 355/113 = 3.14159292... and pi = 3.14159265...
- deleted 6y ago[deleted]
- hanoz 6y ago> 355/113 Just memorize those six digits to get you four digits beyond the three that everybody knows.
- fsckboy 6y agoi just memorized it as / 1 1 3 3 5 5 / where you start with the denominator and circle back.
- cgriswald 6y agoSo you've got to remember three digits, the fact they are doubled, the place to start, and the place circle back (or deduce any of those). Or you can remember 1592 as the year Trinity College in Dublin was founded. You didn't know that? You probably won't forget now.
- function_seven 6y agoHa. I don't think I'll remember '1592' directly. Easier to remember the offset of '+100' and combine it with my existing knowledge of who sailed the ocean blue.
- AnimalMuppet 6y ago
- taylodl 6y agoAccording to my numerical computing classes the best value of PI on your computing platform is: atan(1.0) * 4 And if there's no math package on your system already defining PI then that's the value you should use - assuming there aren't legal requirements mandating other values to be used instead.
- daveFNbuck 6y agoAre there a lot of systems that define arctangent but not pi?
- gandalf013 6y agobc calculator doesn't (or didn't) define pi, but has atan. I've used "4*atan(1) method" in bc to get pi.
- ape4 6y agoThis works, `echo 'scale=100;4*a(1)' | bc -lq`
- kens 6y agoThe cheap Sinclair Scientific calculator (1974) was rather primitive, so instead of storing constants internally, it printed constants such as e and pi on the case. The calculator was rather inaccurate, so you were much better off using 3.14159 from the case than computing 4×atan(1), which gave 3.1440.
- taylodl 6y agoIt'd be interesting to see their implementation and the trade-offs its designers made.
- kens 6y agoI'm glad you asked :-) I reverse-engineered the Sinclair Scientific calculator, documented its code, and built a simulator: http://files.righto.com/calculator/sinclair_scientific_simulator.html http://files.righto.com/calculator/sinclair_scientific_simul... The short answer is that they used a 4-function calculator chip with just 320 words of ROM and managed to reprogram it into a cheap scientific calculator, a remarkable feat. The tradeoff was that the calculator was very slow and inaccurate.
- kens 6y agoThe article seems a bit backward to me. The reason they use 3.141..793 is because that's the value of pi in double precision floating point. And that was set by the Intel 8087 coprocessor. So to me, the real answer is that Intel (and Kahan) decided on the number of decimals in 1980, and NASA uses that because it's the standard. On the other hand, in the 1960s NASA figured out exactly how many bits of precision they needed to get to the Moon and came up with the 15-bit Apollo Guidance Computer; 14 bits wasn't enough and 16 bits was more than they needed. (The computer supports double precision and triple precision for tasks that needed more.) The point is that in the 1960s, aerospace systems would carefully consider exactly how many bits they needed and build systems with bizarre numbers of bits like 15 or 27. Now, they use standard systems, which generally have way more accuracy than needed.
- ivanbakel 6y agoThe article doesn't try to justify the exact number of decimal places - and, by eye, the arguments it uses are likely to work to 14 decimal places as well, since the error would be similarly small. Instead, it tries to answer the thrust of the prompt question: given the massive numbers used in spaceflight, is pi calculated to the greatest possible practical accuracy? Going over the history of the 15-digit version would divert from the interesting part of the article (the effect of precision on calculation) and dilute a nice teachable moment. Though that fact about the Apollo Computer would make an interesting part of a follow-up.
- kens 6y agoThe Apollo Guidance Computer wasn't 15 decimal places; it was 15 bits. The point is that they didn't use power-of-two word sizes back then; they used whatever word size fit the problem, even though that now seems bizarre.
- deleted 6y ago[deleted]
- ivanbakel 6y agoBut the number in the article is to 15 decimal places. Pointing out that that precision comes from the size of the modern double-precision floating point representation doesn't really answer why that representation is enough.
- ben_w 6y agoGiven the formula for relativistic excess radius [0] as applied to Earth gives 1.478 mm [1], or 0.23173 parts per billion, anyone using at least 10 significant figures is wasting effort unless they’re also accounting for general relativity. Naturally, I had already memorised the first 12 digits of π years before I found out about that. I’d be surprised if NASA wasn’t accounting for GR as standard, what with Mercury etc., but for the rest of us, 10 sf should be enough. [0] https://www.physicsforums.com/threads/what-is-feynmans-excess-radius-for-a-black-hole.322567/ https://www.physicsforums.com/threads/what-is-feynmans-exces... [1] http://www.wolframalpha.com/input/?i=G%2A%28earth%20mass%29%2F%283%2Ac%5E2%29 http://www.wolframalpha.com/input/?i=G%2A%28earth%20mass%29%...
- thatcherc 6y agoThank you for this comment! I remember the radius excess from undergraduate relativity, but for months I've been unsuccessfully looking for its name or a brief reminder of how it works. What luck!
- jonasenordin 6y ago...EVERYONE!
- SeanLuke 6y agoIf they're going all the way out to 39 or 40 digits (and I understand they're normally not), they might as well stop at the Feynman Point.
- dehrmann 6y agoThat's how much we need for space travel within the solar system. What about using the size of the universe and the Planck length?
- lmilcin 6y agoI have memorized 3.1415926 which is better than 1ppm and have been overkill for every practical use I ever had in my life.
- chowells 6y agoFunny. If you're going to stop there, you should end it with a 7 to minimize errors. The above, while technically true, is exactly as pointless as it sounds. The error is lower with a 7 than a 6, but if either of them is an acceptable approximation, the difference is irrelevant.
- lmilcin 6y agoObviously, I know this, but it rhymes better with 6 at the end (I am Polish). There is only few instruments I have been around in my life that can actually measure this difference. I have 6.5 digit Voltmeter which would almost be able to detect it in certain situations if I somehow contrived the experiment, but not in any practical measurement where I actually had to calculate anything.
- mark-r 6y agoLots of people memorize more digits of pi than they need, just because it's fun. I've noticed that most who do this stop at 50 digits after the decimal point. When I was younger I knew 250 digits, now I'm lucky to remember beyond 100. 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647 I haven't practiced in a while, I hope that's right.
- Sohcahtoa82 6y ago> 3.1415926535897932384626433832795028841971693993 [...] I know this much is correct because that's how much I've memorized.
- saagarjha 6y agoI know it’s correct because the rest goes off the page.
- andi999 6y agoHere is the insane thing about pi: any digit of pi can be calculated directly in hexadecimal. https://en.m.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula https://en.m.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80... Like, you can compute digit 10billion without knowing any of the previous digits (in hex..) If this doesnt prove the matrix then I do not know what does ;-)
- throwaway_pdp09 6y agoHow utterly strange. Thanks for that.
- boneitis 6y agoQuite. And, it has me wondering. Would that not mean that we then have just as quick of a way to calculate an arbitrary decimal digit of pi? Hexa and dec feel geometrically close enough for any dec digit to be fully "covered" by a couple calculations of contiguous hexa digits.
- perl4ever 6y agoFrom what I've read, it's not equally easy, and nobody has figured out a way yet, including the really smart people who came up with the hex algorithm. Maybe there is something special about a power of two base.
- boneitis 6y agoHow deliciously intriguing. I'll have to take some time and try to sink my teeth into this one.. someday :) e: Although alas, after an ounce of consideration of some blown up exponents for 10 and 16, it feels a little(read: much more) daunting to find a clean, mechanical conversion.
- systemvoltage 6y agoHow do you verify if it’s correct?
- Zeturic 6y agoYou don't need any digits of pi. You should be using tau.
- Aardwolf 6y agoAnd in binary, the bits just shift, so same thing to remember
- hyperman1 6y agoYou know, even if I know plenty of digits, I can't think of any real world reason in my personal life for needing more decimals than 3.14 . If I add one more, that's a correction of less than 1/1000 and no measurement I do is that precise. NASA's rocket trajectories are less precise than that. Of course, extremely precise devices need better, but they are removed far from my everyday life. Has anybody needed more than 3.14?
- CydeWeys 6y ago> correction of less than 1/1000 and no measurement I do is that precise. NASA's rocket trajectories are less precise than that. Source? If you make that big of an error you're gonna fail your orbital insertion at the other end entirely when going to places like Mars, let alone any farther.
- vidanay 6y agoI don't have a source to support the OP, but I would think there is a significant allowance for course correction that reduces the required precision. It's not a purely ballistic trajectory.
- CydeWeys 6y agoThe mid-course correction is not because you used an imprecise value of pi. If that's all it were about, you'd just use a precise pi from the beginning and then not even need the mid-course correction. Missions have failed because the rocket engines failed to start up for the mid-course correction. Unnecessarily risking that because for some reason you insist on using far fewer digits of pi than your computer is capable of would be insanity.
- vidanay 6y agoThe context of my statement/question was definitely "given the precision that can be achieved with available precision" and not with an arbitrary imprecise constant in the calculations. As you say, the mechanical aspect of the launch and transfer orbit insertion is going to be several orders of magnitude more imprecise than the mathematical goal - that is what the mid-course corrections are for (aka the difference between theory and reality)
- dang 6y agoDiscussed at the time: https://news.ycombinator.com/item?id=11316401 https://news.ycombinator.com/item?id=11316401
- bigmilesjr 6y ago3.14 pieces to be exact hahahah
- sulam 6y agoThis answer is fine as far as it goes, but it ignores the loss of precision involved if you iteratively compute with it. This does happen, even in contexts that NASA cares about. Hopefully they look for this, or they will find they've managed to navigate to the wrong star on some future interstellar mission.
- pmiller2 6y agoOkay, so you can calculate the diameter of a gigantic circle with ~40 digits worth. Big deal. Most mathematical formulas that use pi aren't about circles at all. I am wondering if there is a physical application that actually would benefit from more than 40 digits.
- nicbou 6y agoWhat are they about?
- rrmm 6y agoI'm sure GP means they are not explicitly about calculating a circle. Lots of values of pi occur in various formulas all of which end up going back to a circle or trig function at some point, (for example fourier transforms, normal distributions, any periodic motion, etc).
- intrasight 6y agoWhen my daughter was a teenager, she could recite Pi to 100 digits. I told her that it meant that she could measure a circle the size of the known universe to within the diameter of a proton. :)
- simonblack 6y agoIs that "need" or "find convenient"? 1 in a million gives you an error of roughly 132 feet (40 metres) in the circumference of the Earth. 1 in 100 million brings that down to 1.32 feet (0.4 metres). 1 in 100 million is a mere 8 decimal places (out of the billions of decimal places that we've computed for pi.)
- api 6y agoSince space is quantized, this would mean that the infinite nature of Pi is non-physical. A mathematical realist could argue that this makes irrational numbers like Pi a mathematical curiosity that lacks objective reality and that at most a few hundred digits of Pi are "real." (Guesstimating what would be required to circle the universe with a precision down to the Planck length.) Is there a counterargument to this? Is there a case where the infinite irrational nature of Pi would be physically realized?
- WalterBright 6y agoBack in college, my roommate was working on a program to compute Pi to 900 places or so. This was looong before you could google to find out how to do it, so he was inventing it. He had a prototype that would calculate about 100 digits or so. I asked him how he knew it was correct, and he said in high school he was going for the Guinness world record in memorizing Pi, and he simply knew it was correct. (By the time he was ready to break the record, someone else showed up with having memorized a couple thousand places or so, and he gave up.) We were allotted strict computer time limits on our accounts on the PDP-10. He figured he could get a thousand digits on the remaining time on his account at the end of the year, and set it up to run overnight. The program calculated the digits, but had some disk error and writing the output file failed. He couldn't rerun it because he had no computer time left, and that was that.
- gmiller123456 6y agoBack in the late 90's me and a friend were memorizing PI just for fun. I got to 300 digits. Based on how long it took me to recite those 300 digits, we estimated that the world record holder at that time spent about 16 hours just reciting the numbers. I can't imagine the time they must have put into memorizing it.
- YZF 6y agoI just memorize 3.14159265 since the following digits are 35 (I'll never be able to un-remember this now) my error is like 1 in 10e9 and I've never used Pi in any context where that was even close to mattering. The most accurate calculations I ever had to do in software needed about 1um in a meter accuracy... so I have 3 orders of magnitude of accuracy margin. Never tried to get a spaceship to the edge of the universe with any accuracy though ;) I prefer to use built in values usually since they are typically accurate to the full precision but on platforms where for some reason that wasn't available... Of course the specific calculations you're doing also matter since small errors can accumulate to larger ones if you're not careful... Another personal anecdote is that in a company that shall remain unnamed we used to have a Pi from memory competition every Pi day (3/14). The president of the company always won. I don't recall how many digits he knew but it was some ridiculously high number (hundreds). I much prefer my family tradition of eating pie on Pi days.
- Agentlien 6y agoWhen ytmnd was all the rage I had https://pi.ytmnd.com/ https://pi.ytmnd.com/ open for way too long and it unintentionally burned the first 9 digits into my memory.
- aimor 6y agoThe source is one of my favorite music videos. https://www.youtube.com/watch?v=XanjZw5hPvE https://www.youtube.com/watch?v=XanjZw5hPvE
- Agentlien 6y agoThat was fun. I watched it with my kids, who don't know anything about math nor English, they enjoyed it but had no clue what was going on.
- deleted 6y ago[deleted]
- olliej 6y agoIIRC it was a US state that decided we only needed one decimal place of accuracy - I want to say Kansas, but it could have been Oklahoma or Indiana I think?
- peter_d_sherman 6y ago>"How Many Decimals of Pi Do We Really Need?" Here's the thing about the transcendental numbers, of which Pi is one of, all of them contain information. All of them (and if someone knows of an exception, please let me know) seem to be able to be generated by functions, iterated functions, where the result of one iteration of the function is fed back into the equation (aka algorithm, aka function, aka "series of repeated steps") for future iterations... In that respect -- all transcendental numbers -- can be thought of as fractals. Think of it this way, Nature herself has a way of indexing a whole bunch of fractal algorithms via numbers that have a decimal after the integer component, and an infinite series of digits after that decimal! Which also seems to imply (via reversal of cause and effect) that infinite information -- can be stored in the proper fractal equation -- although, that's just a personal hypothesis at this point with no real proof to back that claim up... Anyway, math people out there, feel free to correct me on any or all of this (I claim Socratic ignorance in my reasoning process! <g>) -- but please cite concrete examples to back your specific claim... You know what someone needs to do? Look at the number gaps between multiple transcendental numbers... I don't mean like the number gap between pi and phi, or e and phi, or pi and e -- I mean like you take an algorithm for a transcendental, and you bump it (inside of its algorithm) by an integer value of one, then two, etc. If you still get another transcendental, then what is the gap between those transcendentals? In fact, what is the smallest gap between two transcendentals, and why is this so? Also, what kind of information -- does that gap represent? ?