How Many Zeros in a Row are Possible in Pi?

Obligatory article on Niko Tosa, the man who beat roulette.

The insight is that you don’t need to know where the ball will land. You just need have a clear idea where the ball absolutely will not land, then quickly spread your bets over the remainder. It turns out that modest imperfections can affect the wheel’s drop zone. Following a 2005 UK government report, casinos became much more careful about how roulette wheels were constructed and monitored for probability shifting wear and tear. Bloomberg has a more detailed but unfortunately paywalled article.

Are a finitist? Most mathematicians don’t worry that constructing the set of all whole numbers will fail at some unknown finite number.

If seven maids with seven mops
Swept it for half a year,
Do you suppose,’ the Walrus said,
That they could get it clear?’
‘I doubt it,’ said the Carpenter,
And shed a bitter tear.

No, I mean that even mathematical proofs are prone to human error. The probability of there being serious errors in our understanding of math is very small… but 1/1040 is just unimaginably tiny. If every human on the planet made a decision every second for their entire lives, if there was a single error in there it would only get you to 1/1020.

It does help a little that hopefully Earth’s mathematicians aren’t all making the same errors, so if a sufficient number of mathematicians look at something and don’t find a problem, then our confidence goes up exponentially (and thus the chance of error might indeed be less than 1/1040). But that’s not going to be true for some of the most advanced proofs, where only a handful of people might have any understanding of it. I think that Wiles’ proof of Fermat’s Last Theorem has much more than a 1/1040 probability of being flawed, for instance.

Is being a “finitist” a real thing? How does that work?

If you’re a finitist, you say that infinity doesn’t exist but leave out the threshold.

If you’re an ultrafinitist, then you deny the existence of any number larger than you can count to.

With an appropriate definition of what it means for a number to “exist”.

Is this a typo? I’m lost otherwise.

I was a little sloppy in how I expressed it, but the numbers 10^40 and (38/18)^123 are roughly equal. The odds of rolling a 10-sided die 40 times and getting 1 each time are about equal to getting red on a roulette wheel 123 times in a row.

All I’m saying is that extremely unlikely events can and do happen, though 1040 is indeed hyperbole. For example, the odds of winning the jackpot in one of our local lotteries is approximately 1 in 14 million. With the number of tickets being sold it’s not surprising that someone wins the jackpot at least half the time, if not more. But the thing is that, despite the fact that the jackpot odds are so ridiculously remote that buying tickets is for all practical purposes precisely equivalent to throwing money away, a number of people have won such lotteries twice (not sure about this specific one). If my calculations are correct, the probability of winning a lottery with those odds twice is around 1 in 196,000,000,000,000, yet it has happened and no one has uncovered anything being “rigged”.

A bit off topic but: Perhaps the most famous (within areas of math adjacent to mine) recent example was a proof published by the Fields Medal winner Vladimir Voevodsky and Michael Kapronov in 1989. A counterexample was found by another mathematician in 1998, but it took until 2013 for Voevodsky to convince himself the original proof was wrong. The fact that a mistake like this could go undetected and unconfirmed so long (along with other mistakes he discovered in another paper of his) disturbed him so much that he spent the rest of his life developing homotopy type theory, a foundation for math that lends itself to computer theorem proving/verification software. He tells the story himself in a lecture whose slide deck is available online.

Very interesting; thanks. I do think that proof assistants will help greatly. I almost used the 4-color theorem as my example, but it’s been checked by theorem-proving software so I decided on a different famous example.

I’ve been hearing good things about the Lean prover, but don’t know anything about its underpinnings.

Software can certainly contain bugs, but I don’t expect these bugs to manifest in subtle proof errors. Lean at least has a library of proofs you can use to prove further things, but at any point you can verify the library down to the fundamentals. So there’s no notion of things being on a rickety tower of other proofs that you can’t totally depend on.

My last entry in this hijack: I haven’t used proof assistants myself, but it looks like Lean is one of those using dependent type theory, not homotopy type theory (HoTT), as its underpinnings. There’s a rundown of various proof assistants at the nLab. Another page shows libraries of results built using HoTT specifically.

I’m a bit tired at the moment, so I could certainly be mistaken. But if something has an independent probability of 1/n, repeated over n events, the probablility of it happening at least once is 1-[[(n-1)/n]^n], that is one minus the probability of it not happening even once in n tries. This would seem to converge to (1-1/e), about 64%, with a 1/e chance of not happening at all in the first n tries.

Thanks for the explanation.

Sure thing. And if you want a simple mental approximation, a single 10x multiple is worth approximately 3 2x multiples. Alternately, one decimal digit is worth three binary digits, etc. So 10^40 =~ 2^120.

It’s actually closer to 3.3, but that’s only 10% error, which you can ignore for this sort of thing.

Something with an independent probability of 1/n has about a 36% chance of not happening in n tries and a 13% chance of not happening in 2n tries. The approximations get better as n gets bigger.

Another vote for double precision. Stata allows for single or double precision storage but does all of its calculations in double precision. So you get rounding error in the single precision variables and resulting display columns like this:

.01
.02
.03000001
.04
.05000001

Now you can get around that with proper coding, aka extra programming time. No thanks: I’ll store everything double to avoid the issue. Storage is cheap.

Admittedly Stata President Emeritus and author William Gould seemed to like single precision storage as of 2012. But that advice was outdated even then I think, unless you are working with very large datasets. Sometimes you are!

But yes, single precision (known as float in Stata’s language) is fine for most calculations. William Gould:

Using double all the time also removes worries about whether your variable might be used for an intermediate calculation:

Personally I use storage types as a way to indicate what kind of variable I’m using - is it a dummy or categorical variable, an integer, or a real number (byte, long, and double in Stata’s language)? For me it’s a label for the programmer more than a way of saving storage space.

(Stata has other storage types, but I don’t need to get into them here.)

In the late '80s, at my first IT job, my boss presented me with an old school (max 2 letter variable names) basic program and told me to find out why it didn’t give the same results when we ran it on a new 286 pc clone as it gave in the old Zenix TSR-80 II or whatever it was.

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.

Pretty math heavy.

I couldn’t specify the precision of variables in old school basic so I wrapped every calculation in a function that rounded the result to a specified number of decimal places before assigning the result to a variable.

The closer the the number of digits were to 8 (approx. single precision) the closer the end result came to what the old computer said. Showed my boss why the numbers were different and why the new ones were better.

In any math heavy software, there are intermediate results stored in variables. Many calculations are iterative.

LTDR: Might have been different in the '80s but in the '20s declare all floating point variables as double unless you know why you’re doing otherwise.

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.

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).