Computation of the n'th digit of pi in any base in O(n^2) (1997)
bellard.org
bellard.org
All the above is a joke, of course, as it does not really tackle the problem :)
Redacted: see below.
https://chat.openai.com/share/aadf6a17-f40e-4ea6-8f5e-236bc2...
ChatGPT 4 gives a more correct answer:
> Pi is an irrational number, meaning it has an infinite number of digits that don't repeat in a predictable pattern. So, there's no such thing as the "last" digits of pi.
https://chat.openai.com/share/6a7c0221-0aca-48af-8938-e4d98e...
A cryptographically secure pseudorandom number generator lets me pump out a stream of digits that's certainly computable, but unless you know my private key, you won't be able to predict it.
(Finding out the private key from the stream is 'computable', because the definition of computable is comfortable with running exponentially long brute force searches. But that's why 'computable' is not a useful definition in practice. You want something that captures 'tractable', not just 'possible on a Turing machine at all'.)
The most intuitive answer is just computability.
If you have finite memory, you have a finite number of states and will eventually return to a previous state. In your example, you eventually will run out of memory to track the number of consecutive zeros.
> The decimal representation of pi is infinite and non-repeating, so it doesn't have "last 8 digits" in the way a finite number would. However, if you're looking for the first few digits of pi, they are 3.14159265. If you need more digits, you can find them using various sources or tools that provide the decimal expansion of pi.
In other words, if pi basically sums up the most important fact about a circle's geometry, then it's reasonable to expect that geometry to be represented somehow in the important facts about algorithms that calculate pi.
We square complex amplitudes to make them real.
https://twitter.com/westurner/status/967970148509503488 :
> "Partly because, mathematically, wavefunctions are vectors in a L^2 Hilbert space, which is complex-valued. Squaring the amplitude, rather Ψ∗Ψ=|Ψ|^2 is one way to ensure that you get real-valued probabilities, which is also related to the fact that […]" https://physics.stackexchange.com/questions/280748/why-do-we...
Your statement suggests that the definition via the circle is more fundamental that other definitions, which it isn't, e.g. because it requires a very special metric in Euclidean space (of which there are infinitely many), while real analysis only requires a metric on the real numbers.
edit: it was just atan https://github.com/sharplispers/cormanlisp/blob/master/examp...
This algorithm here runs in O(n^2). I'm not sure how impressed I should be. Bellard himself wrote this paper [1] in 2010 where he showed how he calculated 2.7 trillion decimal digits of pi. The algorithm was essentially linear (with some logs and powers of logs thrown in there, like in all self-respecting algorithms). Of course, 2010 was 13 years after 1997, maybe in 1997 O(n^2) was the best someone could get. I'm getting the impression however that the ingredients for the 2010 record were all there since the record established by the Chudnovsky brothers in 1988 [2].
[1] https://cloud.google.com/blog/products/compute/calculating-1...
Not constant time; the analysis in the paper shows that the nth digit can be computed in O(n log n M(log n)) bit operations, where M(j) is the bit complexity of multiplying two j bit numbers.
> Bellard's formula was discovered by Fabrice Bellard in 1997. It is about 43% faster than the Bailey–Borwein–Plouffe formula (discovered in 1995).