Computable function example

190 Views Asked by At

Suppose $p(x)\in\mathbb{Z}[x]$. How can we show that the function $b\to$ the least non-negative integer root of $p(x) - b$ is computable (if there is no such root, then the function is undefined)?

One thing I thought of was trying to define the function in terms of a GCD operator or sgn function to show that we have something that is p.r. which is then computable

1

There are 1 best solutions below

0
On BEST ANSWER

You don't need to work too hard. Let $p(x) \in \mathbb Z[x]$ if $a \in \mathbb Z$ is a root of $p(x)$ then $a \mid c$ where $c$ is the constant term of $p(x)$, this is the rational root theorem. So to find the least positive integer root it suffices to enumerate the divisors of the constant term, which is surely computable and pick the smallest one that satisfies $p(x)$. If no such root exists return null or whatever the fail character is.