63 points · by akkartik · 3y ago · 35 comments
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...
> 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.
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.
All the above is a joke, of course, as it does not really tackle the problem :)
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.
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).