Turing machine algorithm and Natural number

581 Views Asked by At

Let T be a deterministic Turing machine and let A be a set of all algorithms which is running on T.

I know that there is an algorithm F which can transform an Algorithm $X$ into a Natural number $m$.

$F(X) = m$

$X∈A$ and $m∈\mathbb{N}$.

Question: Is there a function such that has inverse function also? It means, $F^{-1}(m)=X$ for all $m∈\mathbb{N}$ as well as $F(X)=m$ for all algorithm X. It means F is injective and surjective.

About Turing Machine, can we guarantee the existence of F?

1

There are 1 best solutions below

1
On BEST ANSWER

Let $F$ be a computable bijection from the set of algorithms $A$ to $\mathbb{N}$ then we can invert $F$ as follows:

To compute $F^{-1}(n)$, set $i=0$, check whether $F(i) = n$, if yes, output $i$ if no increment $i$ and repeat.

This is computable, as $F$ is, and it always halts because $F$ is a surjection and so $n$ must be in its range.