4 ms·
Any given program P either terminates or not. So yes, for any fixed P the function that h_p() that returns 0 or 1 is computable. Same is true for a function h_N
by alexey-salmin 2y ago
Any given program P either terminates or not. So yes, for any fixed P the function that h_p() that returns 0 or 1 is computable. Same is true for a function h_N(P) that accepts only a finite set of possible inputs -- it's a switch case.
However a generic function h(P) that can accept any program P is not computable and the switch-case approach won't work.
Long story short, the question of computability only considers whether an algorithm exists or not, not whether humans know it or not -- that is irrelevant to the question.
Consider the following example from wikipedia [1]:
> The following examples illustrate that a function may be computable though it is not known which algorithm computes it.
> The function f such that f(n) = 1 if there is a sequence of at least n consecutive fives in the decimal expansion of π, and f(n) = 0 otherwise, is computable. (The function f is either the constant 1 function, which is computable, or else there is a k such that f(n) = 1 if n < k and f(n) = 0 if n ≥ k. Every such function is computable. It is not known whether there are arbitrarily long runs of fives in the decimal expansion of π, so we don't know which of those functions is f. Nevertheless, we know that the function f must be computable.)
> Each finite segment of an uncomputable sequence of natural numbers (such as the Busy Beaver function Σ) is computable. E.g., for each natural number n, there exists an algorithm that computes the finite sequence Σ(0), Σ(1), Σ(2), ..., Σ(n) — in contrast to the fact that there is no algorithm that computes the entire Σ-sequence, i.e. Σ(n) for all n. Thus, "Print 0, 1, 4, 6, 13" is a trivial algorithm to compute Σ(0), Σ(1), Σ(2), Σ(3), Σ(4); similarly, for any given value of n, such a trivial algorithm exists (even though it may never be known or produced by anyone) to compute Σ(0), Σ(1), Σ(2), ..., Σ(n).
[1] https://en.wikipedia.org/wiki/Computable_function https://en.wikipedia.org/wiki/Computable_function