Here is an algorithm that solves this:
print 1 for 1 to 10^(10^100) print 0
One can trivially prove correctness using the Logic of Chorus :
- No preconditions
- The post-condition is that it prints one after it zero 10 ^ (10 ^ 100)
- The loop invariant is that the number of zeros printed so far is
i
EDITING: a machine to solve a problem requires the ability to distinguish one googolplex of different states: each state is the result of printing another zero than the previous one. The amount of memory required for this is the same as for storing the number one complex. If there is not enough available memory, this problem cannot be resolved.
This does not mean that this is not a computable problem: it can be solved using a Turing machine, since the Turing machine has an unlimited amount of memory.
R. Martinho Fernandes
source share