Determine whether two primitive recursive functions are equal

405 Views Asked by At

Is there an algorithm to determine whether two primitive recursive functions are equal (as mathematical functions)?

1

There are 1 best solutions below

1
On BEST ANSWER

No. In fact, the set of all (codes for) partial computable functions with a specified graph is undecidable – this is a straightforward corollary of Rice's theorem.

Of course, one may also directly appeal to the halting problem as follows. Let $\mathfrak{M}$ be a Turing machine with specified input tape, and consider the function $f : \mathbb{N} \to \{ 0, 1 \}$ such that $f (n) = 1$ if and only if $\mathfrak{M}$ halts in $\le n$ steps. This is certainly a computable function and is even primitive recursive. Then, if we were able to determine whether $f$ is equal to the constant $0$ function, we would be able to solve the halting problem for Turing machines – so there is no (Turing machine) algorithm that can determine whether two primitive recursive functions are equal.