Uncountable number of functions representable by programs

87 Views Asked by At

I was reading an old thread here and came across an interesting answer. I was familiar with the Halting Problem, however it never dawned on me that there can only be countably infinite computer programs and this got me thinking.

Obviously all the functions $$x^n$$ can be implemented as computer programs. But so too couldn't all the functions $$x^{{n_1}^{{n_2}^{{n_3}^{...}}}}$$ where $$n_k \in (0..9)$$ Of course each of these would take a near infinitely long time to run but it would still exist computationally and be iterable. Correct me if I am wrong but wouldn't this imply there are uncountably infinite computer programs?

The argument I am hearing is it'd be impossible because you'd have to hardcode an infinite number of characters but I don't feel this is valid because much like the argument for the uncountability of the reals you can always create a unique program by adding another exponent much like how you could always a create a unique real by adding a digit.

1

There are 1 best solutions below

2
On

It depends on what you mean by $\ldots$ in $x^{{n_1}^{{n_2}^{{n_3}^{...}}}}$. If that's a finite tower, it's just the same as $x^n$ for some suitable $n$. If it's an infinite tower of arbitrary $n_i$'s, whatever that means, then no, you can't implement more than countably many different ones.