π is the ratio of a circle's circumference to its diameter: 3.14159… Its digits go on forever and never settle into a pattern (π is irrational, in fact transcendental). That sounds like the ultimate hard problem — an answer with infinitely many digits.
And yet computing π is, in the language of this site, solved and efficient. You can write a program in a handful of lines that prints as many correct digits as you have patience for. The infinitude isn't the obstacle; you simply ask for n digits and the algorithm delivers them. The interesting questions are: how fast do the digits come, and what does it take to reach a trillion of them?
π is the perfect example of a problem that sounds impossible (infinite output!) but is actually a story about algorithmic efficiency and engineering — not undecidability.
Comments
Loading comments...