How do they compute Pi to a trillion digits?

According to the wikipedia article

Pi has been computed to 5 trillion digits. Most computers I am familiar with are 32-bit or 64-bit architecture, well short of even a million digit resolution, so they must be using special techniques. What kind of algorithms and other tricks do they use to make such a computation?

Just store the extra digits another way-- not as a single number.

If your doing arithmatic on a number, so that you want to feed it into the ALU, then you need to fit it in a 32 or 64 bit word. But no ones doing arithmetic with all these digits of Pi, you don’t need all the previous digits to get the next one. So you just need to store them, and you can use as many bytes as you want until your harddrive fills up.

Yep. You could store the digits as characters in a text string of arbitrary length.

It’s slightly mind-boggling to think that they’ve computed pi to such accuracy that it requires a 5-terabyte hard drive just to hold it. Particularly when:

Also, the Chudnovsky Algorithm for computing Pi is notable in that it doesn’t require you to make the entire calculation in one go- you can compute to so many digits, store the result, and then continue on from there.

The fraction 355/113 overestimates Pi by only about 0.000000266, a greater degree of accuracy than almost any object has ever been machined to. In other words, if you had a perfect circle exactly ten kilometers in diameter, it would overestimate the circumference by just over 2.66 milimeters

Actually, if it’s 5 trillion digits, you only “need” slightly more than 2 terabytes, if you represent the whole thing as a giant base-2 number. Even using “base-100” (i.e. each byte holds 2 digits instead of 1) like Oracle does means you only need 2.5 TB.

Of course, there is also the additional space you need to hold the preliminary computations.

It’ll get easier. After 6 trillion digits it starts repeating.

Inquisitive nerds need to know!

I find your post to be irrational.

To the contrary. I find it the definition of rational. :slight_smile:

And to think an engineer I once worked with freaked out when I used 3 for Pi. Heck, we were pulling a dozen other guesstimated numbers out of our ass to do the calculation. 3 for pi was the most accurate number in there :slight_smile:

This is a serious question, and I hope I don’t mess it up by making it sound like a snarky insult.

Is that an algorithm for computing pi? Ot is it really an algorithm for approximating pi?

The reason I ask is this: That formula involves numbers like 545140134 and 640320. I would not expect a formula for a number as elegant a pi to be dependent on such apparently random numbers. Did the Chudnovskys find 545140134 and 640320 based on some other formula, or are they the result of trial-and-error experimentation?

That Wiki article has a link to another, titled “Approximations of π”, which contains a large number of other formulae. Many of them indeed seem to be mere approximations. For example, the first of the “Machin-like formulae” uses the number 5 and 239. Is there anything special about 239 that I’m not aware of?

Formulas like the “Gregory–Leibniz series” shown there seem much more exact to me. But maybe I’m wrong, and that’s why I’m asking: If there anything special about 239 and 545140134?

I am not familiar with the Chudnofsky algorithm, but there is an algorithm (Jon Borwein was one of the creators, maybe his brother Peter was also involved) for computing the trillionth **binary ** digit of pi. Or the quadrillionth. Conversion to decimal, however, would probably be just as hard as the actual computation, maybe harder. But any method I am aware of for computing the trillionth decimal digit presupposes you know all the previous.

Other than purely as an abstract intellectual endeavor (not meant to malign if so), is there any practical (in the real world or within mathematics) use for knowing pi to such detail?

I don’t think it can be for any real circle since I think 60 digits or so would get you the universe down to the planck length. So any uses beyond calculating to the picometer the circumference of an almost infinite universe?

Take a look at that Wiki article. It shows many methods, some of which allow you to find any arbitrary digits without first finding the previous ones.

There are many, if you don’t define practical as being limited to measuring circles.

For decades, the computation of pi has been a standard way of testing computers. Since it’s known to greater accuracy than anything else it’s useful as a reference point to ensure accuracy.

In math itself, there are many problems that are unsolved that the examination of the digits of pi can help. Pi can’t repeat - it’s been proven to be irrational and transcendental. But nobody knows whether the digits are normal, that is, whether there are equal numbers of 0,1,2,3,4,5,6,7,8, and 9 (and therefore also 10, 11, 12 and up). Whether it is or not would affect much other math theory.

Normal is related to randomness, and randomness is the buzzword of the day for encryption and quantum processes and everyday stuff. In the long ago, a book was published of 1,000,000 random numbers, because the need for random numbers was inexhaustible and ordinary processes in those early computer days
were too slow to generate large quantities of random numbers when needed. Today the need is still as great, but a trillion numbers are preferable because a million is just too small. If pi were a perfect random number generate - truly random and not pseudo-random like known processes - it would be a huge boon.

I’m sure the math mavens know of dozens of other applications. And I don’t discount purely intellectual curiosity. History tells us that math has an uncanny habit of becoming real-world not matter how abstruse it originally appeared. String theory is the latest example of math nobody thought had any application at all. (That doesn’t mean string theory is necessarily correct. But it’s stimulating huge amounts of valuable research, even if something else wins in the end.)

Cool, thanks.

But computing pi to any finite degree of accuracy won’t help ascertaining its normality.

Of course, all random numbers are normal, but that doesn’t work the other way around – Champernowne’s number (0.12345678910111213…) is obviously normal, but hardly random.

If pi were random, it wouldn’t be computable.

Only for base 2 digits (or any base which is a power of 2). To find, say, base 10 digits, you need to know all the previous digits as well.

Is that true? I take the random part to mean that each decimal place digit "appears to be random. Obviously in one sense its not because you computed it. But statistically, is the digit sequence “random”.

Damn, now I don’t even know what random/non random really means. My world is falling apart!! :slight_smile: