Hacker News new | ask | show | jobs
by GolDDranks 2350 days ago
That specific function can take infinite time to decide whether the input x belongs in the case x < 0, x = 0 or x > 0. The problem manifests itself if we allow x to be a true real number. As you surely know, real numbers may have infinite amount of digits after the point, and if we get a real 0.00000000000... as the input, we must continue inspecting it, until we can be sure about which case it belongs to. But because that real might contain infinite amount of information, we might never finish!
1 comments

I disagree, how interesting. :-)

I presume that you're allowing finite time execution of the equality-to-zero operation (I.e., a function that says if a number is equal to zero). If you don't, I suppose one would conclude (by applying the same arguments, whatever they are) that neither can a function that, say, adds numbers or does similarly trivial operations finish in finite time, in which case this distinction of finite- vs infinite-runtime functions isn't very interesting.

Any number that isn't zero and that starts with a zero (at the left of the dot), will always have a finite number of zero digits after the point. In other words, the only number that has a zero at the left of the dot (i.e., of the form 0.xyz...) that has an infinite number of zero decimals is zero itself.

I guess where we disagree is in this claim: "As you surely know, real numbers may have infinite amount of digits after the point". The only real numbers with this property are the integers. Every other real number has to have a finite number of zeros.

Here's a more practical definition than "a stream of digits". A computable real representing the real number x is a program that takes as input a rational ϵ>0 and produces as output a rational number within ϵ of x. That is, it produces approximations to x to any desired level of precision.

Every rational q is computable: λϵ.q

The sum of two computable reals, x and y, is computable: λx,y.λϵ.x(ϵ/2)+y(ϵ/2)

You can show the absolute value function is computable: λx.λϵ.|x(ϵ)|

So there are many trivial continuous functions like addition that are computable.

But the discontinuous function f(x)=1 if x=0, f(x)=0 otherwise, is not computable.