Puzzle time - Recovering the Polynomial
-
The Oracle at Delphi has in mind a certain polynomial p (in the variable x, say) with non-negative integer coefficients. You may query the Oracle with any integer n, and the Oracle will tell you the value of p(n).
How many queries do you have to make to determine p?
-
Well n+1 points define a polynomial of order n, in the same way that two points define a line, but the restriction to non-negative integer coefficients must make a better answer possible. The way the question is worded implies that a constant answer suffices for polynomials of any order. Can a polynomial expression with non-negative integer coefficients be simplified into a form of a(x^n)+b?
But the answer is probably not to simplify it a priori, but rather to gather information from the first guess to narrow down which would be the most informative next guess.
-
I think if I could query the oracle with any number, not just integers, I could do it with just one query.
Just take an arbitrary transcendental number (such as Pi). No two integer-coefficient-polynomials will agree on that number. Enumerate all non-negative-coefficient-polynomials until you get to the one that agrees with the result. (the method is not entirely practical, though, because it depends on comparing numbers that cannot be finitely represented with digits).