# How Many Zeros in a Row are Possible in Pi?

**URL:** <https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562>\
**Category:** Factual Questions\
**Tags:** science-math\
**Created:** [September 21, 2024, 5:12pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562 "2024-09-21T17:12:42Z")\
**Posts on this page:** 20\
**Page:** 7

<div class="post-metadata">

**Author:** ![Measure\_for\_Measure](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/measure_for_measure/32/557_2.png) [@Measure\_for\_Measure](https://boards.straightdope.com/u/Measure_for_Measure)\
**Post date:** [September 27, 2024, 5:37pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/121 "2024-09-27T17:37:34Z")

</div>

How many digits of pi do we need? NASA typically uses 16, presumably because that’s the double precision representation.

> For example, Voyager 1 probe, which is now in interstellar space, is currently more than 15 billion miles (24 billion km) from Earth. If you wanted to calculate the circumference of a circle with this distance as the radius, the difference between using the first 16 digits of pi compared with hundreds of digits would be less than the width of a little finger, according to NASA.

The maximum practical number of digits required is 38 according to the article, which I’ll round up to 40:

> For example, if you wanted to calculate the circumference of a circle that encapsulated the known universe, the radius of that circle would be around 46 billion light-years — the distance light has traveled since the Big Bang when factoring in the expansion of the universe. In this case, you would need 38 decimals of pi to get a value with the same level of accuracy with which we can currently measure the width of an atom, according to NASA.

An atom? What’s that in Plank units? That would be 10^25 according to Joe Blow on the internet at Quora. So I say we should keep 100 digits of pi, just to be safe. Though 70 would be fine.

Citation:

> **[Why NASA uses only 16 of the 105 trillion digits of pi we know](https://www.livescience.com/physics-mathematics/mathematics/pi-day-2024-why-nasa-uses-only-16-of-the-62-trillion-digits-of-pi-we-know)**
>
> On Pi Day (March 14), NASA reminded us why we need only a small slice of the irrational number's infinite decimal places to explain most of the known universe.

So… what the heck are we doing past, say, 200? 😕

ETA: The gang in charge of calculating the fundamental constants of the universe uses the quadruple precision representation of pi, or 32 digits. [Cite](https://www.scientificamerican.com/blog/roots-of-unity/how-much-pi-do-you-need/). Also:

> Pi computation can be used to test computer precision, but I think this is a symptom of pi-mania rather than a legitimate need for pi. Other numbers could be used just as meaningfully, but we choose to use pi.

Not sure I buy the author’s POV: I mean using something well understood, broadly understood, and epic seems sensible.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 27, 2024, 6:04pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/122 "2024-09-27T18:04:13Z")

</div>

Quadruple precision = 34 digits  
Octuple precision = 71 digits (though one might ask what is wrong with your algorithm that you really need that many digits…)

> [@Measure\_for\_Measure](#):
>
> Not sure I buy the author’s POV: I mean using something well understood, broadly understood, and epic seems sensible.

If it’s just a test, I don’t think the specific constant matters but the algorithm does: should be exercising vector instructions, multiple cores, NUMA, etc— I don’t even know exactly what, but every CPU and I/O feature available, to get maximum performance. And, of course, you need to check your answer…

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [September 27, 2024, 6:19pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/123 "2024-09-27T18:19:11Z")

</div>

I remember back in ancient times (in computing terms) one system I programmed in could do 9 decimal digits of precision. If you’re cutting a cake down to the molecule level that’s good enough.

In Physics, the largest number of digits I ever saw anyone use was 14. They were calculating some value of a hydrogen atom. Maybe they are up to 15-16 digits now.

(One thing that I saw all too often was “advice” along the lines of “If your input data is single precision is use double precision operations to reduce arithmetical loss.” Nope, you’re just wasting time multiplying/adding junk extra bits.)

---

<div class="post-metadata">

**Author:** ![scudsucker](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/scudsucker/32/14101_2.png) [@scudsucker](https://boards.straightdope.com/u/scudsucker)\
**Post date:** [September 27, 2024, 7:15pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/124 "2024-09-27T19:15:16Z")

</div>

> [@Q.Q.Switcheroo](#):
>
> I’ll see you and raise you _A Portrait of the Artist as a Young Man_:

God, that was a tiresome novel.

Had to study it for GCSE ‘A’ Level in my final year of school. Never read Joyce since.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 27, 2024, 8:07pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/125 "2024-09-27T20:07:49Z")

</div>

> [@Dr\_Paprika](#):
>
> Sure. And I’ve seen estimates there are 10^82 atoms in the observable universe. Can you speed up the generator? In kind of a hurry here… 😉

The problem isn’t the speed. There are digit-generators that grow the number of digits exponentially (e.g., every iteration has twice as many digits as the previous one), which can keep up with big numbers like 10 to the 1000, if run for a reasonable amount of time. The problem is storing all of those digits.

> [@ftg](#):
>
> (One thing that I saw all too often was “advice” along the lines of “If your input data is single precision is use double precision operations to reduce arithmetical loss.” Nope, you’re just wasting time multiplying/adding junk extra bits.)

With many programs, the amount of extra time needed by the program is less than the amount of time that would be expended by the programmer determining whether double precision was needed or not. If performance actually matters, then make sure you’re working efficiently (which could mean lower precision, or it could mean restructuring your loops, or it could mean using a different language, or…). If it doesn’t, then just call everything double precision and call it a day.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [September 27, 2024, 8:30pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/126 "2024-09-27T20:30:23Z")

</div>

> [@Measure\_for\_Measure](#):
>
> How many digits of pi do we need?

See also the correspondance at the end of this column:

> **[How do scientists go about calculating pi to umpteen decimal places?](https://www.straightdope.com/21341987/how-do-scientists-go-about-calculating-pi-to-umpteen-decimal-places)**

---

<div class="post-metadata">

**Author:** ![Dr\_Paprika](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr_paprika/32/3042_2.png) [@Dr\_Paprika](https://boards.straightdope.com/u/Dr_Paprika)\
**Post date:** [September 27, 2024, 8:54pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/127 "2024-09-27T20:54:10Z")

</div>

Very nice. Much better than my quote.

---

<div class="post-metadata">

**Author:** ![Dr\_Paprika](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr_paprika/32/3042_2.png) [@Dr\_Paprika](https://boards.straightdope.com/u/Dr_Paprika)\
**Post date:** [September 27, 2024, 8:58pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/128 "2024-09-27T20:58:33Z")

</div>

Do you _need_ to store all those digits if they are accurate and the only thing of interest is repetition? I presume that you do need to if the next iteration depends on the last one, which is already mindbogglingly huge. But how many digits could you realistically store? How many digits would you need to?

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [September 27, 2024, 9:20pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/129 "2024-09-27T21:20:02Z")

</div>

> [@Dr\_Paprika](#):
>
> Do you _need_ to store all those digits if they are accurate and the only thing of interest is repetition?

The quadratically converging algorithms that **Chronos** mentions require storing all the digits. They depend on every step happening with full precision.

There are single-digit algorithms that you could use, keeping only a running count of the longest strings you’ve encountered, but these techniques are much slower than the quadratic algorithms. So there is a tradeoff.

Some people did compute the 100 quadrillionth (hexadecimal) digit of pi. That’s about 1000x farther out than what pi can been fully computed to.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 27, 2024, 10:47pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/130 "2024-09-27T22:47:18Z")

</div>

Fairly sure it was Archimedes who popularized the huge-piles-of-sand meme…

---

<div class="post-metadata">

**Author:** ![Lumpy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lumpy/32/446_2.png) [@Lumpy](https://boards.straightdope.com/u/Lumpy)\
**Post date:** [September 27, 2024, 10:54pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/131 "2024-09-27T22:54:26Z")

</div>

Calculating (and storing the value of) pi to trillions of digits allows researchers to test various hypotheses in number theory related to pi. For example so far pi remains approximately normal.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 27, 2024, 11:42pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/132 "2024-09-27T23:42:06Z")

</div>

But that doesn’t actually get them any closer to knowing if pi is truly normal. Heck, if they calculated it to a trillion digits and found that every digit from the billionth digit to the trillionth were all zero, they still wouldn’t know whether pi is normal.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 27, 2024, 11:45pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/133 "2024-09-27T23:45:08Z")

</div>

Oh, and

> [@Dr.Strangelove](#):
>
> Algorithmic randomness implies normality. Therefore non-normality implies non-algorithmic-randomness. There are other things it can’t be also, like a “truly” random sequence that you got by flipping a coin.

If I could roll a die an infinite number of times, then I could generate an irrational number by rolling a d6 for every binary digit, and writing down a 1 every time I got a 6 on the die, and a 0 for every other die result. That number would be truly random, with an infinite information content, but it would not be normal.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [September 27, 2024, 11:51pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/134 "2024-09-27T23:51:54Z")

</div>

Sure, though I thought it was clear from the context that I was talking about even distributions.

The sequence from your proposal is “random” but is highly compressible. I can divide it up into blocks and assign fewer bits to those strings that contain about 1/6 ones and 5/6 zeroes. Blocks with differing proportions would require longer bit strings, but they’re much less probable and so I get a savings overall. The first trillion bits would require less than a trillion bits to store.

But if the bits are generated by a fair coin flip, you can’t do anything like that.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 28, 2024, 1:23am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/135 "2024-09-28T01:23:33Z")

</div>

A number may be normal while failing other statistical tests of randomness, not that anyone has yet found any such bias in the digits of pi, or _e_, etc., as far as I know.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [September 28, 2024, 1:29am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/136 "2024-09-28T01:29:59Z")

</div>

> [@Dr.Strangelove](#):
>
> I can divide it up into blocks and assign fewer bits to those strings that contain about 1/6 ones and 5/6 zeroes.

Just to correct myself a bit–it’s actually the all-zeroes string that’s most probable. Strings with about 1/6 ones are more probable _in aggregate_, but individually, the fewer ones the more likely. So it would get the fewest bits, and strings with more ones would get progressively more bits. If I chunk into 256-bit blocks, then the all-zeroes string would get 68 bits, while the all-ones string would get 662 bits. As the block size increases (or I use some alternate scheme like arithmetic coding), I only need 0.65 bits to store the digits.

---

<div class="post-metadata">

**Author:** ![Francis\_Vaughan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/francis_vaughan/32/3093_2.png) [@Francis\_Vaughan](https://boards.straightdope.com/u/Francis_Vaughan)\
**Post date:** [September 28, 2024, 4:06am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/137 "2024-09-28T04:06:41Z")

</div>

An aside on precision.  
Asking how many digits of precision is needed to usefully represent the result is the wrong question.

Numerical instability is a very real issue and still under appreciated in far too many areas. It is entirely possible to get an answer that is just plain wrong if care isn’t taken. Sometimes more precision is the only way to tame calculations. The hard yards have been done in the well known numerical libraries in terms of getting the algorithms right. But even then you only get so far. Performing sensitivity analysis and tests should be part of any numerical code writing. But it is often ignored. I am quite sure there are research results out there that are basically nonsense because of this.

Sadly this stuff doesn’t get taught in many disciplines. I still remember a chemist colleague telling me how he caught a grad student blithely accepting a computational result - and having to explain how negative Eigenvalues were indicative of non-physical results.

Even in computer science little is taught. All the kids want to get rich using LLM AI. This isn’t good.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [September 28, 2024, 4:29pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/138 "2024-09-28T16:29:42Z")

</div>

I took the phrase “algorithmic randomess” to mean in a Kolmogorov sense. The lopsided sequence you mention is quite definitely not random in a Kolmogorov way. (It will compress, for example, fairly well.) YMMV

---

<div class="post-metadata">

**Author:** ![robby](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/robby/32/11048_2.png) [@robby](https://boards.straightdope.com/u/robby)\
**Post date:** [September 28, 2024, 4:48pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/139 "2024-09-28T16:48:37Z")

</div>

> [@Jasmine](#):
>
> Pi is an irrational number. I can’t possibly imagine it having ten in a row of any digit, including zero. I’ve spent time looking this up, and all I see are the words, “it is conjectured that”. Show me a calculation of pi that reaches a point where it has ten zeros in a row. Below is the longest calculation I could find on line in a cursory search. Looking at it, nothing seems to be remotely close to repeating ten times in a row…

You have to look a lot further than that. From the same cite I posted up in Post #11, there is a sequence of 12 zeroes starting at position 1,755,524,129,973.

Also, “you can’t possibly imagine”? [Argument from incredulity](https://en.wikipedia.org/wiki/Argument_from_incredulity) is a fallacy in informal logic.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 28, 2024, 5:04pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/140 "2024-09-28T17:04:14Z")

</div>

14 zeroes in a row already show up among the first 10 trillion digits. As far as anyone can tell, the sequence of digits appears not merely normal but random-looking, therefore one _should_ expect to see any pattern with its natural frequency.

[Previous page](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562.md?page=6)

[Next page](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562.md?page=8)
