4 ms·
An algorithm for computing pi would be a finite sequence of operations. Even if the operations include "do an infinite loop".
by lopmotr 6y ago
An algorithm for computing pi would be a finite sequence of operations. Even if the operations include "do an infinite loop".
- eru 6y agoPedantically enough, by formal definitions algorithms have to finish. See eg https://en.wikipedia.org/wiki/Algorithm https://en.wikipedia.org/wiki/Algorithm In practice, speaking informally, people talk about programs that may run forever all the time. People have developed lots of theory around those as well. Of specific interest here would be the class of programs that provably only runs for a finite time before it produces the next bit of output. You need that latter class of programs to talk about producing digits of pi, or running the main loop of an OS. See also https://en.wikipedia.org/wiki/Total_functional_programming https://en.wikipedia.org/wiki/Total_functional_programming
- mannykannot 6y agoThen, I would say, you would be publishing a fact about pi, not pi itself. These facts do not yield pi in any finite time.