0
$\begingroup$

$\forall f: \mathbb{N} \to \mathbb{N}$ primitive recursive function, whose most values are equal to $0$, in general can there be algorithmically found a number $N$ such that $(\forall i > N)\,\,f(i)=0$?

With "most of values" is meant that $\sum_{i=0}^\infty {f(i)}$ is finite. I think that such an $N$ cannot be found if we aren't considering some special case, because no matter for how many values of $i$ you check, you never know if $f(i+1)=0$ or not. This in the general case, but I'm not sure how this can be proven. It looks like the halting problem in some sense, but I'm not sure how to find a real connection between them.

This is not a problem from a textbook, but an intuition of mine, while trying to solve this: Show that infinite sum/product of primitive recursive functions can be non-recursive.. I decided to ask this separately to isolate it from the main question.

Am I right that such an $N$ cannot be found for the general case?

UPDATE Here is what I have just tried. Could you verify if its a valid solution?

Consider a Turing machine which should halt when run on input $y$. Consider the primitive recursive function $\xi(n)$ which is equivalent to the Godel number of $n+1$ $1$s. Consider the primitive recursive function $H(t)$ that returns the Godel number of the sequence of all symbols on the Turing machine on moment $t$. If the Turing machine has halted, then it keeps returning the same value. And finally consider the function $h(t) = sg|H(t)-\xi(y)|$. Then according to our supposition $\exists N_1$ such that $\forall t > N_1 \implies h(t)=0$, in other words, the output does not change anymore, which means that we have solved the Halting problem which is not possible.

The primitive recursiveness of $\xi$ can be easily shown. $H(t)$ is a Godel number which is generated from the function that is computed by the Turing machine, so it is primitive recursive.

$\endgroup$
6
  • $\begingroup$ In general? I do not think why... Consider e.g. $f(n)=n$ that is obviously p.r. $\endgroup$ Commented Jan 17, 2022 at 9:53
  • $\begingroup$ @MauroALLEGRANZA thanks, I've forgotten to mention, that most of $f$'s values are actually equal to 0, just some of them aren't. I have to edit the question. $\endgroup$
    – H-a-y-K
    Commented Jan 17, 2022 at 9:55
  • $\begingroup$ The function $f(n)=n$ for odd integers and $f(n)=0$ for the evens is easily p.r., since you can just check what was the last value and then either put 0 or $n$ as the next. $\endgroup$
    – Asaf Karagila
    Commented Jan 17, 2022 at 9:57
  • $\begingroup$ @AsafKaragila thanks for the comment. yes, but there are infinite odd numbers. In my case just some of the values are non-zero, in other words there are finite many possibilities for $i$, for which $f(i)\neq 0$. Sorry for the initial ambiguity. $\endgroup$
    – H-a-y-K
    Commented Jan 17, 2022 at 10:00
  • $\begingroup$ Oh. I see. Try proving that by induction on the generating tree of $f$. This is trivial for the basic functions; then show that you can find this $N$ for composition and recursion constructors, given the upper bound for the functions you've input into them. $\endgroup$
    – Asaf Karagila
    Commented Jan 17, 2022 at 10:15

1 Answer 1

1
$\begingroup$

I can't quite follow your proposed argument (what is "$sg$"?), but indeed the conclusion is correct: there is no computable way of doing this.

In my opinion the cleanest way to see this is as follows. For each $n$ let $g_n$ be the function sending $x$ to $0$ unless the $n$th Turing machine on input $n$ halts in exactly $x$ steps, in which case $g$ outputs $1$. The $g_n$s are all primitive recursive, and in fact are uniformly primitive recursive - the binary function $(n,x)\mapsto g_n(x)$ is prmitive recursive.

Now the $g_n$s are each almost always $0$, regardless of whether $n$ is in the halting problem or not. However, if we know that $g_n$ stabilizes by stage $k$, we can check whether $n$ is in the halting problem by running the $n$th Turing machine on input $n$ for $k$ steps and seeing if it halts in that amount of time.

I suspect this is more-or-less what you've proposed, but as I said above I can't quite follow your argument.

$\endgroup$
2
  • $\begingroup$ Thank you for the answer! sg is the sign function, I am checking if the Turing machine has reached the final value $(y+1)$ and thus halted. And if it has halted on the moment $t=T$, then $H(t)$ will keep giving the Gödel number of $y+1$ ones for any $t \geq T$, and as every discussed function is primitive recursive then according to the supposition there exists an N beginning from which $h(t)=0$ which means we can determine whether the Turing machine halts or not and we can determine the exact moment, which is not possible. $\endgroup$
    – H-a-y-K
    Commented Jan 18, 2022 at 7:12
  • $\begingroup$ I'm not still sure if mine is valid, but in any case your solution is much cleaner and more elegant. Thanks! $\endgroup$
    – H-a-y-K
    Commented Jan 18, 2022 at 8:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .