# Google calculates Pi to 100 trillion digits

Google has put its cloud to work calculating the value of Pi all the way out to 100 trillion digits, and claimed that's a world record for Pi-crunching. The ad giant and cloud contender has detailed the feat, revealing that the job ran for 157 days, 23 hours, 31 minutes and 7.651 seconds. A program called y-cruncher by …

1. Finding any 'pattern' might take a bit longer than the calculation.

1. something that decodes to "Apologies for the inconvenience" ?

1. #### Re: errr

Check their tax returns at the end of this year, maybe they will be saying it cost 50 cents a digit, deductible from the Google "cloud" income?

3. #### They'd get a shock...

If they found that the last few trillion digits were all zeroes!

1. #### Re: They'd get a shock...

I wonder what the longest set of zeros was in those trillion digits...

1. #### Re: They'd get a shock...

First thought would be that 100 Trillion is 1015, so the longest sequence of any particular digit should be around 15 digits in length.

Please correct me if I'm making a dumb error, but I did say it was a first think.

1. #### Re: They'd get a shock...

The digits of PI seem, to the naked eye, perfectly random.

If they were effectively random, they might be all the same, all 100 trillion of them (extremely improbable, but possible - just might be one of those random things)

1. #### Re: They'd get a shock...

If they were truly random, it would be no more improbable to have all zeros than any other combination of numbers of course.

1. #### Re: any other combination of numbers of course.

But care needs to be taken not to confuse combinations and permutations when making inferences here....

2. #### Re: They'd get a shock...

There is only 1 configuration with all 0s possible. Any other SPECIFIC configuration would be equally probable, but it would be almost (but not quite) 100% probable that you would end up with one of the non-zero configurations.

This is why lottery winning numbers are in practice always a random distribution rather than a numeric sequence.

1. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

So you are saying I should quit playing 1,2,3,4,5,6 in the lottery?

Which is a bad sequence to pick. My states lottery once said that that was the most popular guessed numbers. So while it is just as possible as any other combination in a 6 number lottery. The fun of winning millions will go down a bit when you find out you have to share it with a few thousand other people.

1. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

That's why an ex-boss always plays 1,2,3,4,5,11 (he argues that some people may already play 1,2,3,4,5,7).

1. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

So why not pick numbers above 30/31, so that those using dates don't scavenge from the pot before the jackpot is determined.

PS - I haven't done any statistical analysis of the distribution of chosen numbers.

1. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

Yes, that is true. When choosing numbers, people tend to go for "familiar" numbers, often birthdays. There has been quite a bit of "research" into the "best" numbers to pick for a lottery. Since, as stated, any one combination is a likely as any other, clearly the best numbers to choose are those least likely to be chosen by other players such that if you do win the jackpot, you minimise the chances of having to share with others. Of course, all that "research" might be negated by the fact it exists and now people know about it. On the other hand, "human nature" :-)

2. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

"PS - I haven't done any statistical analysis of the distribution of chosen numbers."

That's ok. Somebody else has.

tl;dr version - pick the least popular numbers.

http://news.bbc.co.uk/1/hi/sci/tech/240734.stm

1. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

"choosing a ticket at random produces a long term winnings of 45 pence in the pound"

Pretty sure they mean it produces long term losses of 55 pence in the pound

2. #### Re: lottery ... numbers are in practice always a random distribution rather than a numeric sequence

I heard of a local guy who always played the same number sequence, and he always bought multiple tickets with the same numbers for a given drawing. His explanation was that way when he won he would get multiple shares if the prize was split.

I confess that I find myself unable to craft a rational counter to his argument.

2. #### Re: They'd get a shock...

When someone PIs around, is the result checked against the previous output as far as poss.?

3. #### Re: They'd get a shock...

Pi's NOT random, it's just not a simply repeating pattern, so the digits have their own statistical distributions. One of the reasons you don't seed crypto with Pi instead of an RNG.

The other gent pinned a better estimate based on previous work, as they either had the paper close at hand or a much better memory than I do.

Interestingly, this relates on one of the things this kind of run can shed light on, the statistical distributions, which do have some value in other fields.

That hand having a large chunk of non-compressible* data.

(yes, smartypants, technically you can "compress" the thing by storing the formula and recalculating it, in 123 days with non-trivial budget, power, and storage footprint)

That said, other than fully recalculating it, is there an intermediary format that would be faster to calculate but smaller to store? That would be an interesting read, at least for nights that I wanted to mentally confounded for hours and wake up at 3 in a puddle of drool.

4. #### Re: They'd get a shock...

Yes, totally random, that's why my administrator password is always the last 12 digits of Pi - OK, that sounds a little risky but I update it every year!

1. #### Re: They'd get a shock...

>OK, that sounds a little risky but I update it every year!

You change the last 12 digits of Pi every year?

Is that why I have to keep buying new wheels?

2. #### Re: They'd get a shock...

My number theory is a bit shaky, but I didn't think there could be any 'last' digits of pi (that is, it is conjectured that pi goes on for ever, or, if you prefer, that you can continue the expansion indefinitely). I did read a sci-fi story once, that if I recall correctly, involved God hiding a message in the digits that would only be found when an intelligent race developed a certain level of computing hardware. At the time I thought this was quite a silly idea (I still do).

2. #### Re: They'd get a shock...

That's a fair first approximation. It's probably 14 or 15. In the first 10^9 digits there is no sequence of 9 zeroes, but a sequence of 8 zeroes occurs 8 times. There are two sequences of 9 nines.

1. #### Re: They'd get a shock...

And presumably every other sequence of 14 or 15 digits is equally likely?

Therefore, it's likely to include the telephone number and social security number of almost everyone on the planet?

1. #### Re: They'd get a shock...

>Therefore, it's likely to include the telephone number and social security number of almost everyone on the planet?

Possibly not.

There are irrational numbers that go on for ever and contain a random distribution of digits - so all possible sequences exist. And another class that go on for ever but aren't random. (Can't remember what they are called)

AFAIK we haven't proved which type Pi is.

3. #### Re: They'd get a shock...

Not sure why you're getting downvotes. Your basic idea is right, with the minor quibble that 100 trillion = 1014, not 1015. (As a Yank, I will leave it to other commentards to quibble about long vs. short trillions.)

In a sequence of that length, any given string of fourteen digits (fourteen zeroes, or 12345678901234, etc.) has a probability of almost exactly 1/e = 36.8% of appearing zero or one times. The probability of n occurrences of the string is 1/(e * n!). So, an 18.4% chance of two occurrences, 6.1% of three occurrences, and so on.

2. #### Re: They'd get a shock...

Matt Parker had a better question...

And about 43 trillion digits in... Pi has the the first 14 digits of Pi!

2. #### Re: They'd get a shock...

Finding the first occurrence within pi of N repetitions of digit X in a row sounds like a really interesting problem in number theory!

1. #### Re: They'd get a shock...

"a really interesting problem in number theory"

It's all relative, I suppose.

4. Does crunching that much pi help other than making your storage fat?

5. #### spot the difference

> Pi-munching when it went 31.4 trillion digits

Has anyone checked that the first 31.4 trillion digits calculated by this latest feat actually matches the 31.4 trillion digits from the previous run?

1. #### Re: spot the difference

Pi could easily introduce rounding errors!

1. #### Re: spot the difference

There's one in the gut for you!

2. #### Re: spot the difference

you may jest but I've seen rounding errors in serious astrophysics work throw results completely out the window

The funny part is that it got picked up because "The new 64-bit systems are giving wrong answers" - as it turned out the old 32-bit systems weren't right either, just different. If you're evolving stars and galaxies don't use your intermediate results as imputs for the next calculations unless you _really_ understand what compounded rounding achieves

1. #### Re: spot the difference

Not exactly astrophysics, but some old code I modified for artificial satellite orbits had a value of π given to enough places for a 32-bit float, but not for a 64-bit one.

https://projectpluto.com/sat_code.htm#pi_prec

"...The primary purpose of the Data statement is to give names

to constants; instead of referring to π as 3.141592653589793

at every appearance, the variable Pi can be given that value

with a Data statement and used instead of the longer form of

the constant. This also simplifies modifying the program,

should the value of π change."

-- Fortran manual for Xerox Computers

1. #### Re: spot the difference

IEEE 32 bit float gives 3.14159274101257324 as pi.

Not sure what the Sinclair Scientific calculates it at but it did have 3.12415926 on the case.

1. #### Re: spot the difference

OOps I lied - the Sinclair Scientific says 3.14159 and the calculator itself thinks pi/2 is 1.563

1. #### Re: spot the difference

Dunno much about the Sinclair Scientific beyond what's described at the (very interesting and impressive) simulator for it. The case shows 3.14159, as you describe, but it looks as if you could only enter it as 3.1416.

2. #### Re: spot the difference

I'm sure they have but more important is verification of the algorithm used.

3. #### Re: spot the difference

... but if all you do is you keep checking the new result against the old one, isn't that really just like going round in circles?

4. #### Re: spot the difference

Somewhat surprisingly, it turns out to be possibly to compute the Nth digit of pi much more cheaply than computing all the first N digits. This was used to verify the last few digits, making it very implausible that there was a bug in the calculation.

6. #### They should try something more impressive...

Why doesn't Google try something more impressive like that tetration monster 'Grahams Number' - wikipedia.org/wiki/Graham's_number

Ron Graham appeared on one of the old BBC Horizon programs on the subject of infinity - highly interesting.

1. #### Re: They should try something more impressive...

Is calculating the first x digits of an infinite number any more or less impressive than calculating the last x digits of a finite but equally unattainable number?

7. #### apples-to-apples comparison is tricky

That depends on your definition of Apples. I'd say for this publicity stunt, it's "the fastest setup of cloud VMs Google offer." Which makes the speed comparison perfectly valid.

8. #### If they were proper engineers...

..they'd know it was 4, and saved a lot of time and effort.

1. #### Re: If they were proper engineers...

Bloody Stupid…

1. #### Re: If they were proper engineers...

The New Pie

2. #### Re: If they were proper engineers...

Only in Indiana, allegedly.

Bill #246 of the 1897 sitting of the Indiana General Assembly has been claimed to make Pi = 4 but actually would have been 4/1.25 or 3.2.

1. #### Re: If they were proper engineers...

Or in Australia, whose laws overrule the laws of mathematics.

3. #### Re: If they were proper engineers...

It's been a while. Shouldn't there be a Pi 5 sometime soon?

4. #### Re: If they were proper engineers...

For back of the envelope calculations, π² == 10 is a pretty good approximation

5. #### Re: If they were proper engineers...

Pi is roughly 3. As is Euler's number. They'd save even more time if they just made them the same number.

6. #### Re: If they were proper engineers...

And if they were cosmologists, they'd know it was 1. Ok, 10, whatever.

1. #### Re: If they were proper engineers...

Cosmologists also regard everything except hydrogen as "metals"

1. #### Re: If they were proper engineers...

Well roughly it's true

2. #### Re: If they were proper engineers...

Anything but hydrogen or helium. Metals are made in supernovas rather than being around since the Big Bang, therefore anything made in a supernova is a metal.

9. That's an interesting maths question.

Has anyone ever looked at Pi calculations and determined the maximum* single digit repetition length possible?

* not as the final digits such as.333 recurring

1. It's an irrational number so, in theory, there could be series that are infintely long… Actually, more important mathematically than repeating digits are repeating sequences.

1. If that were the case, then somewhere embedded in the digits of pi are the digits of pi... a statement which is either trivial (if we allow the perfect overlap) or paradoxical.

1. So I understood that we know that pi doesn't contain pi, otherwise that would mean it was no longer irrational as it would be trapped and repeating itself.

2. Number theory makes it clear that it is neither paradoxical nor trivial: there's more than one infinity. Also, as it is known that Pi itself is non-repeating, it's also not possible for Pi to contain Pi. You could, I suppose, think about what's the greatest precision ("314") that can be repeated but even if you find that Pi to 1000 digits (or more) is repeated, it won't really help either because the repetition itself is random and in a scale so great as to be practically useless.

But calculating Pi and other irrational numbers to nth digits turns out to have other uses.

Is this one yours?

1. #### Is it known?

I thought it was an unproven conjecture that Pi is irrational.

1. #### Re: Is it known?

I'm pretty sure that every algorithm used to calculate it demonstrate this but it turns out it was proven a while back.

3. more than that, the entire universe is encoded in pi. somewhere.

4. "If that were the case, then somewhere embedded in the digits of pi are the digits of pi"

Recursive Pi? Ugh, I think I just again tasted the Pi I ate this lunch time!

2. This post has been deleted by its author

1. #### Re: We know pi is irrational, so it can't end that way

... or, indeed, end at all.

10. #### AI

What's the bet that someone at google will feed this into some artificial intelligence thingy thinking it can calculate the next 100 trillion?

1. #### Re: AI

Not a good task for AI but maybe some form of quantum computing could be used for validation.

11. #### Measurement creep

In the early eighties my TI-82 calculated pi instantly, 3.1416926. Press of a button, no faff.

I realise there's been inflation since then.

My last love claimed to have memorised the first 102 digits, and she did recite those once but beyond the first eight digits she could have just been making it up - as could this computer. She put me off pi, I'm into tao now.

1. #### Re: Measurement creep

Calculators often lie about things like this. If you subtract the digits you can see on the screen they often shift things along to show some more digits that they were keeping secret from you.

1. #### Re: Measurement creep

"Calculators often lie..."

I have a test for calculators, spreadsheets, etc.

x = 355/113 - PI() = 2.667E-07 on my calculator. So the six most significant digits have been lost.

Then 1/x = 3749531.309, which is seriously wrong.

Excel yields 3748629.088.

An old Quattro Pro also yields 3748629.088

Windows 7 calculator: 3748629.093

An online 30-digit calculator yields 3748629.093

1. #### Re: Measurement creep

My Casio fx-83 says:

3549999698556 / 1130000000000 - PI = 0

Also : PI =3.141592654

So now I know...

1. #### Re: Measurement creep

I see your puny FX-83 and raise you my FX-180P. I programmed it to solve quadratic equations which would take about as long as it did manually. But it was nice to be able to check!

2. #### Re: Measurement creep

My 10" Versalog slide rule says 355/113 = 3.145, or close to that.

(I had to get my reading glasses out to see the numbers. The intersection on the Venn diagram of people who know how to use a siide rule and the people young enough to do so without reading glasses is probably just about empty.)

1. #### Re: Measurement creep

I'm 60 this year and slide rules were still available but calculators with "scientific" in the name and function had just reached schoolboy prices, so I never did get or learn to use a "slipstick".

My first was a Sinclair something or other. White, with red LED display and two AAA batteries. They were still banned in exams at the time though!

1. #### Re: Measurement creep

I'm 57, and used a slide rule a bit (not much) in my early teens. Not sure what happened to it. I now have two of my grandfather's slide rules (pocket versions with not many functions) and recently picked up the Versalog at a thrift shop. Basic calculations are quite straightforward; developing the facility to tackle anything really complicated would probably take more practice than I'm apt to invest. Definitely an elegant computing instrument for a more... civilized age.

2. #### Re: Measurement creep

Probably cheating:

\$ bc -l

scale=1000

pi=a(1)*4

x = 355/113 - pi

1/x

3748629.0926628157868016244511646880974354889954070036234564032865454604793222886800140518816206836356898079757856583284769379701126839058362003772355496229770758776797063438635191977660363361658744058103117300160461407276837111486330913977530873701252813424084198400481405092339036142808124539709683599867051286776490510626222882018048540955721785108550715843278070987656589966381686938060800983246562587555490962488193999331001490603484545747242535590070139275682350221862811047078534288326502531238107419444664984567094661646407825083581568369435126109673237667122066542690481175490950780594741574076038648703833149716962300481919871324782090295149305449951761504107916830115926158948469898610910327249791290301794755871665455486720582729977835980177289213718137555499355392288048490060629138647289009508061564131833621484607268993002381032691514552359573669279876404364535066753777868985530913238716219930154570781566614631309790422382386201404931585554783220139580948786727209918542548521348819205030972

2. #### Re: Measurement creep

> In the early eighties my TI-82 calculated pi instantly, 3.1416926.

You read it wrong! It would be 3.1415926...

</pedant>

1. #### Re: Measurement creep

You didn't open your pedant tag.

-mobailey

1. #### Re: Measurement creep

But he did close it, so no further pedantry is possible past that point.

1. #### Re: Measurement creep

This style of rejoinder is the driving reason for the Daily Headlines being the first thing I read at my desk each day.

3. This post has been deleted by its author

4. This post has been deleted by its author

5. #### Re: Measurement creep

When I was at school I learnt a mnemonic for the first 30 digits:

Now I, even I, would celebrate

In rhymes inapt, the great

Immortal Syracusan, rivaled nevermore,

Who in his wondrous lore,

Passed on before,

Left men his guidance

How to circles mensurate.

But it's been utterly no use to me in the ensuing 50 years - well maybe occasionally to show off (to those who give a damn, so not many!)

For a team claiming a feat in the mathematical world, you would think that they would check what numbers they are claiming. 1 Trillion is 10 to the 18th power, or a million, million, million. Google seem to have calculated to 100 million, million, or in real mathematical terms, 100 billion.

I know that the world seems to have tried to dumb down counting, and popular media counts a 1000 million as a billion these days, but in true maths it is not, and to try and claim 100 Trillion in this context is disingenuous at least, if not downright fraudulent.

2. #### Re: Google can't count

The definition of "trillion" isn't maths, it's English.

3. #### Re: Google can't count

I think it's a case of American measurements being smaller. Like their gallons and pints.

4. #### Re: Google can't count

Sorry sir, but what you call 'real mathematics' is what the rest of the world calls 'old english', and hasn't been taught in schools for over 30 years. Signed by someone who went to school 30 years ago, wasn't taught it then, spends a career in engineering where it isn't used as you claim, and has had to correct the old about it for 30 years.

5. #### Re: Google can't count

My go-to reference, Mathematics - From The Birth of Numbers, from 1997 states that a billion is 1 million million, except in the US where it's 1 thousand million as they based theirs on an older French system than the rest of the world.

From my recollection however that was already out-of-date for the UK when written. It was that way when I was at school, up to about 40 years ago but popular culture (ie US TV) probably started to bring about the change around then.

For the record no true mathematician would risk the confusion and I don't recall terms above 1 million ever being used during my degree, even a million probably only occurred in loose discussions in stats.

1. #### Re: Google can't count, nor can most of world

"states that a billion is 1 million million"

The long form of these numbers is logical =>

1 billion is a contraction of bi-million, a million million.

1 trillion is a contraction of tri-million, a million million million.

n-million=10^(6n), simple.

Instead people use the nonsensical billion=10^(3*3), because it makes things sound bigger than they are.

The other thing that's stupid is using the ratio of the circumference to the diameter. Using the ratio of the circumference to the radius makes much more sense mathematically, and would remove oddball factors of 2 from many equations.

1. #### Re: Google can't count, nor can most of world

The diameter is much easier to measure and can be done with greater precision.

That's why.

But don't worry, have a Tau.

2. #### Re: Google can't count, nor can most of world

Mathematically your correct. What we observe linguistically is literally inflation due to the vulgar use of scientiffic terms, particularly when talking about things like the US budget or debt. Most people don't care about precision, and couldn't explain it anyway, they just want to be able to compare different numbers.

1. #### Re: Google can't count, nor can most of world

If you watch any US documentaries, anything involving mass or weight that is engineering rather than science based, everything is in pounds. They rarely use tons/tonnes. There seems to be a fascination with bigger numbers so use smaller units to get those bigger, more impressive sounding numbers. The everyday people end up using those same methods because that's what TV has impressed on them for so many years.

"OMG! That 70,000 THOUSAND POUND truck SMASHED over the bridge", sounds, to TV producers, far more impressive than "That 35 ton truck bumped the guardrail of the bridge"

2. #### Re: Google can't count

I have said the same thing millions of times

1. #### Re: Google can't count

And I've told you a billion times to stop exaggerating!

3. #### Re: Google can't count

It's pragmatic. We need a name for 1,000,000,000 more than for a million million. And we can call the bigger one a trillion.

13. #### Calculating Pi on a Pi

I might try calculating Pi on my new (Raspberry) Pi and see how far it gets.

1. #### Re: Calculating Pi on a Pi

*Hands you a tall tankard of frothy fun*

Because you beat me to it. =-)p

2. #### Re: Calculating Pi on a Pi

Just make sure to give it a really hot cup of tea.

(And thereafter avoid any science award presentations for extreme cleverness.)

3. #### Re: Calculating Pi on a Pi

If you are calculating Pi on a Pi just make sure its in Python.

14. #### 100 trillion digits

Congratulations.

Now explain to me why this is relevant and what impact it will have on Science and Engineering.

1. #### Re: 100 trillion digits

Pi-pe down you!

2. #### Re: 100 trillion digits

We'll never know what he intended to do - the developer sadly drilled a hole in his head with a B&D cordless shortly after the job completed.

1. #### Re: 100 trillion digits

Really? I heard he discovered something incredible and promptly disappeared in a puff of his own logic.

15. #### OK then

Should be like a land speed record.

No count it DOWN from 100 trillion digits!

16. #### Astonishing!

They actually created something more energy intense and less useful than proof of work blockchain!

bravo!

17. "Google calculates Pi to 100 trillion digits"

Alternatively, you could more easily remember the rational approximation of π that is 355/113 instead. It is accurate to six decimal places and it is within 0.000009% of the value of π.

18. #### Numerical approximation

Worked with a mathematician many year ago. I'm a mechanical engineer and he was horrified that I said both Pi and e could be approximated as 3

1. #### Re: Numerical approximation

I had to do that for my Maths A-level because I'd forgotten my slide rule.

19. #### Google Causing Trouble Again

Once again, for all of the circles in my life, I am going to have to double-check their circumferences and diameters. That is going to take years.

This is almost as bad as the Imperial-to-Metric madness of the 70s. How did that end? Expensively, for every American guy owns not just one set of wrenches, drivers, etc., but two incompatible collections. No American can gauge easily copier enlargements, because nearly no one here uses A4 and the like; the misspent paper has sustained our timber industry for a century.

So, let's just stick to 22/7 for pi, which, whether calculated by hand or device, seems to be a simple, rational choice for a boring, irrational number.

1. #### Re: Google Causing Trouble Again

Only the ones on perfectly flat planes.

So it won't take long

20. Would be more interesting if it calculated the last 100 trillion digits of pi

21. meaningless exercise

22. #### Google calculates Pi to 100 trillion digits

Whoopty-do. So what? Where are the benefits other than a mention in the Reg?

1. #### Re: Google calculates Pi to 100 trillion digits

It's a constant that turns up almost as often as e, so having a more precise estimate means we can recalculate some other things with greater precision too.

Mostly extremely large or small things

1. #### Re: Google calculates Pi to 100 trillion digits

Not to that degree of precision, but there are uses: sources of entropy and validation of the algorithm itself if it's particularly efficient.

2. #### Re: Google calculates Pi to 100 trillion digits

"Whoopty-do. So what? Where are the benefits other than a mention in the Reg?"

How dare you denigrate The Reg in such a way? What greater honour could there be?

23. #### The power of π

My maths teacher (nickname Bong IIRC), with a reputation for enjoying his food, bounced into class one day and declared:

"This is my favourite power of pi" and scribbled on the blackboard.

πt

before proudly declaring to a bunch of confused teenagers:

"I like raising pie to the teeth!"

I expect the reception here will be a similar to that he received many decades ago.

Somehow The Register seems to have conveniently obtained his photo for me to to use as an icon

24. what's the largest available Pi dataset that is free to download? Are there any in the multi GB range? I wonder how well it compresses?

## POST COMMENT House rules

Not a member of The Register? Create a new account here.