# 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:** 11

<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:** [October 2, 2024, 7:45pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/201 "2024-10-02T19:45:08Z")

</div>

[74westy](https://boards.straightdope.com/u/74westy): I seem to recall a paper from the 1980s that reported inconsistent OLS results between even fairly established software programs.

> [@Dr.Strangelove](#):
>
> Storing as double doesn’t avoid this issue. It’s fundamental to floating point, and the fact that 1/5 in binary does not have an exact representation. If you just printed more  
> digits you’d see the problem. Or, if you print fewer digits for single-precision it would avoid that as well.

No, storing it as double avoids the issue entirely, as the problem is in the _display_ of figures (in Stata). You can handle floats if you take time to specify the proper format for each and every variable. But that involves some fiddly though not complicated coding. But yes, there’s rounding error in the ~16th digit for double precision.

> [@](#):
>
> In my industry, even single-precision is a luxury. Half-precision is commonplace. And even less–8 bit, 4 bit, sometimes just one bit (no longer floating point).

Interesting. I see from wiki that half-precision is frequently used in image processing and neural networks. Are the calculations done in double or float?

---

<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:** [October 2, 2024, 7:54pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/202 "2024-10-02T19:54:11Z")

</div>

> [@Measure\_for\_Measure](#):
>
> No, storing it as double avoids the issue entirely, as the problem is in the _display_ of figures (in Stata).

Presumably that’s easy to change, though, and the problem is that that the default is inappropriate for single-precision.

> [@Measure\_for\_Measure](#):
>
> I see from wiki that half-precision is frequently used in image processing and neural networks. Are the calculations done in double or float?

Those would be my areas of expertise.

Internal calculations are done with a mix, though almost never with doubles (just half+single). A dot product is a common operation: a\_1 b\_1 + a\_2 b\_2 + ... + a\_n b\_n . The multiplies can be done in the lower precision, but the additions tend to need more if the dot product has many terms. You can still reduce the precision in the end, but the intermediate calcs need more (similar to what Gould said above).

---

<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:** [October 2, 2024, 8:27pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/203 "2024-10-02T20:27:11Z")

</div>

> [@Dr.Strangelove](#):
>
> Presumably that’s easy to change, though, and the problem is that that the default is inappropriate for single-precision.

Thinking it over, the default may have been chosen to alert the user to this issue: I’m not sure. [Link to example where census tract information really needs to be encoded as a string rather than a float or double.](https://www.statalist.org/forums/forum/general-stata-discussion/general/1433867-stata-generating-garbage-decimal-places-in-float-variable) That link is for reference: this is pretty tangential.

You can change the default storage type from float to double (which I’ve done). You can make a habit of always explicitly defining the storage type (ditto). You can reset the format of any variable individually. I’m unclear about whether you can change the default format for a given storage type.

---

<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:** [October 2, 2024, 10:53pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/204 "2024-10-02T22:53:14Z")

</div>

> [@74westy](#):
>
> The program was written by a nerdy old land surveyor to perform least squares adjustments of survey data. That means it reads a set of survey measurements (measured angles and distances between points.) The measurements are redundant (there are measurements that could in principle be derived from other measurements) and the measurements had some error (duh! They’re measurements). The programs took the measurements a provided a least squares solution that finds a consistent set of measurements that minimizes the amount that measurements have to be changed to make the set consistent. It also calculates coordinates for all points and gives statistical error bars on the location of each point.

I wrote a program like that once, except for orbital measurements, not surveying. It was a lot of fun, but also a lot of work to get it to work right. I think my program was one of about three in the whole class that didn’t barf on the test data (which was deliberately chosen to be uncomfortably close to some coordinate singularities).

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [October 3, 2024, 2:27pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/205 "2024-10-03T14:27:25Z")

</div>

I’m too mathematically naive to know this answer, but could an infinite length string of digits contain an infinite length substring of just one digit? Apropos to this question, could there be an infinite length substring of zeros hiding someplace in the decimal expansion of π?

---

<div class="post-metadata">

**Author:** ![N9IWP](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/n9iwp/32/3154_2.png) [@N9IWP](https://boards.straightdope.com/u/N9IWP)\
**Post date:** [October 3, 2024, 2:35pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/206 "2024-10-03T14:35:35Z")

</div>

I’d say no, if there were an infinite string of zeros then pi would be rational.  
Of course one has to careful about “infinity”/“infinite”.  
Does an infinite string of ones followed by an infinite string of 2’s even make sense?  
I took you question to mean it is only zeros.

Brian

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [October 3, 2024, 2:40pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/207 "2024-10-03T14:40:55Z")

</div>

That’s part of my problem: not knowing the rules of “infinite”. I can imagine things that don’t make sense according to the clear rules of any form of number theory, and I’m wondering if “infinite substring of infinite length string” can make sense.

I know it is allowed in certain cases, like a bounded infinity (the number of real numbers between 0 and 1, for example) but but I don’t know the rules and conventions for an infinite enumeration like a decimal expansion

---

<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:** [October 3, 2024, 11:54pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/208 "2024-10-03T23:54:01Z")

</div>

> [@gnoitall](#):
>
> could an infinite length string of digits contain an infinite length substring of just one digit?

Not if you mean that the “infinite length substring” is consecutive. Because if it’s infinite in length, it never ends; and if it never ends, there are no other digits after it. So then what you would have would be a repeating decimal, which is rational.

But if you mean something like “every third digit, starting with the twelve millionth” I _think_ the answer is “Yes, it could, but then it wouldn’t 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:** [October 4, 2024, 1:19am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/209 "2024-10-04T01:19:38Z")

</div>

This is a case where are have to be careful about what we mean. There’s no infinite substring of zeroes in the sense that at some point it starts having a bunch of zeroes, and they go on to infinity, and then “after” that they’re something else.

However– **if** pi is normal, then the lengths of single-digit substrings goes to infinity. That is, no matter what finite length we pick, there are single-digit substrings longer than that. A thousand digits, a million, a googolplex, TREE(3), whatever. There will be something longer.

That’s with the real numbers at least. Perhaps one could extend the concept so that the digits are indexed by the ordinal numbers, which can go “beyond” infinity into multiples of infinity, powers of it, etc.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [October 4, 2024, 4:45pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/210 "2024-10-04T16:45:22Z")

</div>

> [@Dr.Strangelove](#):
>
> That’s with the real numbers at least. Perhaps one could extend the concept so that the digits are indexed by the ordinal numbers, which can go “beyond” infinity into multiples of infinity, powers of it, etc.

That raises an interesting question: I know essentially nothing about the [hyperreals](https://en.wikipedia.org/wiki/Hyperreal_number), but I wonder if hyperreal numbers have decimal representations indexed by nonstandard integers.

---

<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:** [October 4, 2024, 5:13pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/211 "2024-10-04T17:13:27Z")

</div>

How can you avoid that? If you have hyperreal numbers, then you also have hyper integers, and standard decimal expansion won’t work any more; your digits will be indexed by non-standard natural numbers.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [October 4, 2024, 6:17pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/212 "2024-10-04T18:17:51Z")

</div>

Googling around I find discussions on math.stackexchange that confirm what ought to be the obvious answer: yes.

---

<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:** [October 4, 2024, 6:43pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/213 "2024-10-04T18:43:45Z")

</div>

Here is my interpretation of various big numbers:

Counting of things: applications level off at around 80 magnitudes, the number of atoms in the universe.

Possibilities: a very simple model would the factorial, which is a formula associated with the dinner party problem. For N seats there are possible N! arrangements. Around 60 guests are needed for the number of possibilities to equal the number of atoms in the universe. In a small city, arrange 10,000 households among 10,000 dwellings and you get 2.8e35659, a number taking up about 20 pages (60 characters per row, 30 rows per page). So possibilities are much greater than existing reality.

Exact repetition: Given all the possibilities, how often does history repeat itself exactly? Here we have TREE(3). The general answer is, “Much longer than the amount of time we have to work with (heat death of universe)”, though for common enough events (typically made common via a broad scope definition) the answer would be, “Oh, all the time.” The transition from TREE(2) to TREE(3) is far beyond explosive, beyond the ratio of the longest unit of time to the shortest.

---

<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:** [October 4, 2024, 7:09pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/214 "2024-10-04T19:09:15Z")

</div>

Infinity - hold my beer.

We might run out of actual world computational capacity, but the real number line is long enough to handle any expansive conceptual list that you can throw at it.

---

<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:** [October 4, 2024, 7:15pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/215 "2024-10-04T19:15:53Z")

</div>

> [@Measure\_for\_Measure](#):
>
> Exact repetition: Given all the possibilities, how often does history repeat itself exactly? Here we have TREE(3).

Are you taking about recurrence times in dynamical systems?

When people say things like how long it will take a system the size of our universe to recur, it comes out to a mere 10^{10^{120}} years (or whatever). All this combinatorial tree stuff really has nothing to do with physics. The TREE(3) is, how shall we say, a pretty big number, and talking about how long it will take for history to repeat itself is just peanuts even compared to pretty small numbers— you are not doing yourself any favors thinking of it in those terms.

---

<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:** [October 4, 2024, 7:39pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/216 "2024-10-04T19:39:53Z")

</div>

Thanks for the reply. Looks like it’s back to the drawing board.

---

<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:** [October 4, 2024, 8:16pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/217 "2024-10-04T20:16:39Z")

</div>

[Orders of magnitude (time) - Wikipedia](https://en.wikipedia.org/wiki/Orders_of_magnitude_(time)#More_than_one_second) gives 10^10^10^123\* for “The scale of an estimated Poincaré recurrence time for the quantum state of a hypothetical box containing a black hole with the mass of the observable Universe.”

\*technically, that many Quecto (10-30) seconds; but as the article mentions, at these scales the unit of time chosen is trivial.

---

<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:** [October 5, 2024, 12:47am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/218 "2024-10-05T00:47:09Z")

</div>

> [@Topologist](#):
>
> I wonder if hyperreal numbers have decimal representations indexed by nonstandard integers.

I do wonder what “a decimal number with digits indexed by the ordinals” is isomorphic to, though. It doesn’t immediately give you the hyperreals since those have both infinite and infinitesimal numbers. And I’m not sure it really works on the infinitesimal side, either, though I think it works well enough that you could support non-standard calculus with them.

---

<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:** [October 5, 2024, 3:24am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/219 "2024-10-05T03:24:29Z")

</div>

Ordinals are one thing; hyperreal decimals are indexed by integers. Except now they are nonstandard integers.

(So, we can imagine a nonstandard natural number that is greater than any standard natural number, take that many zeros after the decimal point, then some more digits. The resulting number will be infinitesimal.)

---

<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:** [October 5, 2024, 3:41am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/220 "2024-10-05T03:41:23Z")

</div>

> [@DPRK](#):
>
> Ordinals are one thing; hyperreal decimals are indexed by integers. Except now they are nonstandard integers.

I guess my thought process was that the ordinals are a lot like non-standard integers, at least in some ways. Though thinking about it more, they don’t seem to work. Suppose that you have a binary number that’s zero everywhere except that the ωth bit is 1. What happens when you multiply by 2? Then the (ω-1)th bit is 1, but that’s not actually a digit. So I guess you actually do need the hyperintegers or something where subtraction works properly.

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

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