50 comments

[ 3.4 ms ] story [ 108 ms ] thread
If anyone's looking for a great long-form article about calculating digits of Pi from the good ol' days, this 1992 New Yorker profile of the Chudnovsky brothers (creators of algorithm used by Google here!) is fantastic:

https://www.newyorker.com/magazine/1992/03/02/the-mountains-...

Dammit I was going to post this, but you beat me to it!
Reading that, it's hard not to see the parallels to Darren Aronofsky's movie Pi. Building a supercomputer in an apartment to find patterns in Pi that have some higher meaning, the computer constantly breaking, etc.
but what about the environmental impact?!?
Honestly probably less than all the showers you took in the same amount of time.
The economic impact is not negligible, even if it does come out of the GCP PR budget: about $360k. Yada yada idle servers, but what could all that idle compute be used for to benefit humanity?
Not quite sure how to calculate it, but a n2-highmem-128 instance running at near peak for 24 hours surely uses more electricity than the energy required to heat a dozen or two gallons of water per day.
64 cores and close to 1 TB of RAM will probably consume not more than 2.5 kW or so based on available TDP/power consumption figures.

In 24 hours it consumes about the same amount of energy (2.5kW * 24h = 60 kWh) as charging a Model 3 LR's battery from 0 to 75%. So definitely more than heating up two dozen gallons of water even to boiling temperature (8 kWh), but still within the realm of household consumption with EVs.

When I am king I will make it illegal to loudly worry about environmental impact (or anything else) without providing an order of magnitude estimate for the size of the problem. You don't even have to be right, just take five seconds to conjure a vaguely plausible number.
ponders environmental impact of cat videos
It would be super funny if at 101T digits we find an infinite series of 000000000

And figure: oh shit? Did we solve pi?

I'm hoping for something closer to the ending of Carl Sagan's novel, "Contact". It only mentioned pi on half a page, but it sticks with you.

I won't spoil it, but that book beautifully walked a skeptical / existential / transcendental line and makes you feel a special warmth despite being so immeasurably small.

The book was much better than the (quite adequate) film.

Sagan was an extraordinary communicator.

How would you know it's an infinite series if you're only computing a finite number of digits?

(Also Pi is irrational, so this won't happen.)

There is a dead post in this thread talking about what if "at 101T digits we find an infinite series of 000000000".

I just wanted to point out that this is impossible, because in that case pi would be a rational number. However, it's been proven to be a transcendental number, which is a stronger condition than just being irrational. So, it's not possible that pi ends with any infinitely repeating sequence.

It is almost certain that pi does contain sequences of zeroes of arbitrary length, but that following those zeroes are other numbers.
Isn’t that still just a conjecture that pi’s digits are random-ish?
If you're talking about whether pi is 'normal', it's more than 'just a conjecture' but not something that's been proved.

https://en.wikipedia.org/wiki/Normal_number

But more weirdly, it's possible to find any string of digits within the digits of pi. So there are going to be quite a few zeros in there, followed by ever more non-zeros.

Transcendental numbers are truly awesome.

Small note, this is believed to be true but has not been proven.
Fun fact: Mahler famously showed that if p/q is a rational number then |\pi - p/q| > 1/q^42. So we can't have a string of 4242T zeros after first 101T digits :-) The exponent 42 has since been improved by a series of works to 7.1032 - https://arxiv.org/abs/1912.06345
You can't have a string of 4242T zeroes immediately after the first 101T digits but presumably you could have them sometime later (say after another 10000T digits)
I seem to remember reading a sci-fi story quite a long time ago where the characters discover a message embedded in pi but only after many digits were calculated.

I think the implication was something about simulations or maybe instructions on how to build a device. Can't quite remember the details.

That sounds like Contact by Carl Sagan
In Northern Exposure season 4 episode 3 ("Nothing's Perfect"), a grad student comes to Cicely to study Pi.

"I just have this feeling if I take pi, well past all this static, take pi to 10 million, 20 million digits, that I'll find something really incredible. Not just a pattern, not just an order, but a sign. A mathematical sign."

https://moosechick.com/43.html

(comment deleted)
> Total storage size: 663 TB available, 515 TB used

I was interested to see how they're storing the result (100T digits), it's not clear if this if memory for the result or for the algorithm. I'd be interested to hear what the encoding is; a byte/char per digit, or a nibble?

I would imagine doing something like storing 12 decimal digits every 5 bytes (exploiting 10^12 <≈ 2^40) would be simple enough, great for random access, and good enough at compressing (within 10% of theoretical optimal treating pi as a random sequence of digits) that it's not worth spending a lot of time trying to improve upon that.

Of course, under a different set of constraints, one may find something better.

Did the find the circle hidden in the digits yet?
Yet, it's supposed to happen at the 10^20-th digit in base 11. Mere 10^14 digits aren't enough.
So we've already had the Bailey–Borwein–Plouffe (BBP) formula for computing an arbitrary digit of pi in base 16, which by itself is mind blowing, but I just found out that Plouffe has come up with a new version for base 10.

https://mathworld.wolfram.com/Digit-ExtractionAlgorithm.html

(comment deleted)
But the base 10 formula needs Bernoulli numbers, which themselves are defined recursively, meaning the required iterations are just hidden and not removed.
It would be interesting to know how much was the Google cloud bill at the end of the computation.
(comment deleted)
And how much a computer that could have done the computation all by itself would have cost (by putting enough storage in a single chassis without needing a SAN).
The most disappointing part: It's done with a closed-source program. Just like almost all pi records in the past decades.

The authors of the programs refuse to open source and instead opt to just release free binaries. Their reasons are that their algorithms are secret.

I suspect they don't want their program forked and don't want someone to take credit for a computation done with their program. Surprisingly, it has worked so far.

I found it pretty amazing the codebase that cracked 100T digits (and the previous records too) were started as a guys high school project.
It should be noted that y-cruncher, that closed-source program, is responsible for every pi computation record since 2010 (back then the record was 2.7T digits). Traditionally these records were held by supercomputers, but it seems that pi computation is no longer a good way to benchmark or stress-test them [1], leaving only interested individuals in the scene.

If pi computation were useful by its own, or there were a lot of people working towards records, we can expect multiple competitive pi computation programs where some of them are hopefully F/OSS. (The algorithm itself is not exactly secret anyway and big ideas are already in public, what makes y-cruncher special is its meticulous optimization.) But I don't see anything like that. There seem no actual demands for pi computation software, not just F/OSS.

[1] http://numberworld.org/y-cruncher/faq.html#why_desktops

(comment deleted)
> Start time: Thu Oct 14 04:45:44 2021 UTC

> End time: Mon Mar 21 04:16:52 2022 UTC

> Total elapsed time: 157 days, 23 hours, 31 minutes and 7.651 seconds

> Total storage size: 663 TB available, 515 TB used

> Total I/O: 43.5 PB read, 38.5 PB written, 82 PB total

Yea, but how much energy did you waste for 100T digits of crap, Google???

This was done thru a massive energy crisis, mind you.

The main node has 64 physical cores and 1TB of RAM, and the 24 storage nodes have 8 cores and 16 GB of RAM (192 cores and 384GB of RAM total).

So we are using 256 cores and 1.5 TB of RAM, so probably about 7.5 kW or so. Over 5 months, the compute would have used 27 MWh, so about the energy content of ~750 gallons of gas.

The storage will obviously use more energy (I don't know if they are using spinning disks or SSDs), but I think ~50-100 MWh for the entire computation is a reasonable estimate.