1

$f$ is a polynomial of integral coefficient. Now suppose we have a computer program to find out its output taken in $\mathbb{Z}$. Is it possible for us to find out this polynomial in finitely many steps?

I know the answer is Yes if all the coefficients of $f$ is non-negative. In fact, we only need two steps. First, we input $1$.Then we can find out $f(1)=a_n+a_{n-1}+...+a_0$. Then let $k$ be any integer greater than $f(1)$. Secondly, we input $k$ and from the uniqueness of integer representation of $f(k)$ we know all the coefficients $a_i$.

Can we determine the polynomial in finitely many steps if all the coefficients are just integers?

miracle173
  • 11,441
Ben
  • 3,798
  • What do you mean by the "uniqueness of integer representation of $f(k)$? – Michael Albanese Jun 08 '14 at 06:14
  • 1
    @Michael: I think he means to write $f(k)$ in base $k$ –  Jun 08 '14 at 06:15
  • Disregarding integer coefficients, it's certainly possible to determine a minimum value of the degree of the polynomial. I suspect the problem lies in the fact that you may not be able to bound the degree. – Jared Jun 08 '14 at 06:26
  • If you have not further restriction than that the coefficients are integers then such a polynomial is not uniquely defined. So to any given sequence of integer pairs $(x_1,y_1),\ldots(x_n,y_n)$ you can find infinitely many polynomials $f$ with integer coefficients such that $f(x_1)=y_1,\ldots,f(x_n)=y_n$. – miracle173 Dec 07 '23 at 19:14

2 Answers2

2

If we know $k$ evaluations of $f$, then simply writing out the equations

  • $f(x_i) = $(the value of $f$ at $x_i$)

is a linear system of equations. If $f(x)$ has degree less than $k$, then there are $k$ variables, and this system of equations has a unique solution which can be found by linear algebra. This is the "polynomial interpolation" problem and more efficient solutions do exist.

If $f(x)$ has degree $k$ or greater, then the system of equations has infinitely many solutions.

In particular, it is impossible to recover $f(x)$ if all you know is that it is an integer polynomial and finitely many evaluations of the polynomial.

A more direct proof of this fact is that if $f(x)$ is a polynomial satisfying

$$ f(x_i) = a_i $$

for $i = 1 \ldots k$, then if we define $g(x)$ by

$$ g(x) = f(x) + \prod_{i=1}^k (x - x_i) $$

then we also have

$$ g(x_i) = a_i $$

  • This does prove it (+1). But for full understanding it might be a good exercise (to the OP) to explain, why this does not invalidate the $k=2$ algorithm for identifying a polynomial with positive coefficients (insert evil grin). – Jyrki Lahtonen Jun 08 '14 at 06:30
0

One thing you can do is the following:

We know that $f(0)=a_0$. Using the fact that $$\frac{1}{x}f(x)=a_nx^{n-1}+\dots+ a_2x+a_1+a_0\frac{1}{x}$$ Now consider the polynomial: $$g(x)=\frac{1}{x}f(x)-a_0\frac{1}{x}$$ then $g(0)=a_1$, and you can create an algorithm to exploit this:


Input: polynomial $f(x)$ of degree $n$

$g_0(x) \leftarrow f(x)$

$a_0 \leftarrow g_0(0)$

For $k$ from $1$ to $n$:

$\ \ \ \ $$g_k(x) \leftarrow \frac{1}{x}g_{k-1}(x)-a_{k-1}\frac{1}{x}$

$\ \ \ \ $$a_k \leftarrow \lim_{x\to 0}g_k(x)$