The polynomial p ( x ) is of degree 2017 and has non-negative integer coefficients which you don't know.
If you input a value like x = x 0 , the computer will output the value p ( x 0 ) at a cost of $1.
If you want to determine all 2018 coefficients of p ( x ) at a minimum cost using only positive integer inputs, what is your cost in dollars?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
There is some confusion in the comments as to what is going on, so a practical example using 2 as the degree rather than 2017 might help.
Suppose the polynomial is p ( x ) = 5 x 2 + 3 x + 4 .
First, we set an input of x = 1 and get 5 + 3 + 4 = 1 2 .
Now, we input that sum plus one, that is, x = 1 3 . 5 ( 1 3 ) 2 + 3 ( 1 3 ) + 4 = 8 8 8 .
8 8 8 converted to base 13 is 5 3 4 , which is the coefficients we want.
This is because if we backtrack and consider the meaning of 5 3 4 base 13, it's
4 copies of 1
3 copies of 1 3
5 copies of 1 3 2
that is, exactly 5 ( 1 3 ) 2 + 3 ( 1 3 ) + 4 .
Compare this with the given solution and it should become clearer. Note since our base is always larger than the sum of the coefficients, it will always be possible to represent all coefficients as single digits.
There's also the question of proving it isn't possible to do in 1 check.
Assume $1 is possible. Say that we tested with Z . Then, we just need to find 2 polynomials f 1 and f 2 which satisfy
f 1 ( Z ) = f 2 ( Z )
in which case we are unable to differentiate between these 2 polynomials.
One example is f 1 ( x ) = x 2 0 1 7 + x and f 2 ( x ) = x 2 0 1 7 + Z .
so, what is the correct answer? 2$?
How does this work? I'm confused.
Somehow understood. If we narrow down the question with the following constraints: "All of the coefficients are non-negative integers less than or equal to 9." Then if you plug in x=10, the output of the function is just the number containing the digits as each coefficient.
But how about with coefficients larger than 9? We cannot plug in x=10 as it will cause 'overflow' or 'carry over' of the digits hence we cannot separate the digits. But if we use a base which guarantee larger than any coefficients, the problem doesn't exist. Selecting the base to be the sum of all coefficient is definitely a good choice.
Log in to reply
I do agree with you
Exactly, thank you for your explanation.
Can someone explain the solution?
Even though I've known this solution for a little while, it still constantly amazes me!
How do you know that 2 is the minimum solution? If you input x=pi, p(x) will be of the form a+b(pi)+c(pi)^2+d(pi)^3+... It would be impossible for p(x) to be constructed from powers of pi in more than one way because pi is transcendental. Deconstructing p(x) into powers of pi would certainly be harder than deconstructing into powers of an integer, but it still could theoretically be done. This $1 solution could be eliminated by restricting your choices of x to integers.
By the way, concerning your method, converting a number into a different base is hard, so it would be easier to just set your second value of x equal to the next higher power of 10 after s.
Log in to reply
I tried doing a couple of examples on scratch paper to see practically how Mr. Xiang's solution would work (but using degree 3 or 4, for obvious reasons), and your power of 10 suggestion really does simplify the math nicely. Good idea Mr. Ross.
I have the same idea.😁
Hi John. Thanks for your input! We've modified the problem to address the issue that you raised.
Log in to reply
The problem talked about inputting numbers into a computer, which would only give outputs up to a certain decimal accuracy. In that case, you would not be able to rely on the transcendency (nice word) of an input anyway, correct?
Log in to reply
@David Ortiz – Yes, I see your point. Perhaps we should think of the "computer" as an oracle that can provide us with the output of the polynomial given an input instead of a literal machine without finite precision. Thanks for your comment!
@David Ortiz – You are technically correct. The issue of computer accuracy had occured to me, but I figured that the problem was more theoretical than technically literal. Good point though. :)
Amazing problem
For ease of actually performing the example, you don't have to use x_1=s+1, just use the next power of 10. In your example of p(x)=5x^2+3x+4, you got p(1)=12. Then you can input x=100, getting p(100)=50304. From this, it is simple to read off the coefficients of 5,3,4 without having to change bases (technically we are changing bases, but converting from base 10 to base 10^n is way easier than base 10 to base 13).
Note that we cannot just use x=10 in this example, because the polynomial p(x)=x+11 would also give p(1)=12, but p(10)=21 gives the wrong coefficients.
What if the original coefficients were not single digit?
Being practical, and assuming the computer can provide results with an unlimited number of digits (as the high degree of the polynomial suggests), in most cases we could get the answer with $1 by trying a high power of ten from the start. This is what I thought at first and what I would do if I were supposed to undertake the task more than once. But, of course, this would not work in those cases where you have no clue as to how large the coefficients could be...
p(x) = 20 * x^2+ 3*x + 1 which is a very simple contra-example.
p(1) = 24 p(1)+1 = 25 (base)
p(25) = 12626 (base 10) , which converted to base 25 is K51. Nice one !
I think there is an error in your assumption or i did a mistake ?
suppose p(x) = 1+12 x+123 x^2 we will input x=1 so p(x)=136 since the sum of the coefficients is 3 digit-number then the biggest coefficient has no more than 3 digits so the next input is 1000 (number of zeros equals number of digits) which gives 123,012,001 where every 3 digits from right forms a coefficient. therefore the coefficients are 1, 12 and 123 and finally the answer is 2$.
What if the equation is 1+12x+99x²? The sum of coefficients is a 3-digit number , but the biggest coefficient has only 2-digits!
Log in to reply
thanks for the feedback.I meant to say that the biggest number is no more than 3 digits. now it is edited. but you still need to use the second input as 1000. the idea is that your second input is 10^n where n is the number of digits of the sum, so you guarantee that every 3 digit-number is a coefficient.
I really had no idea what the question meant, but I hazarded a guess at doing the following:
2 0 1 8 2 0 1 7 + 1 = 1.999504459
i.e. if you like... last year divided by this year, plus the difference in years between the two years.
Then it said the answer had to be an integer, so I rounded it up to 2, and it was correct. Forgive me for what is, I suppose, just a lucky guess. This is my first day on Brilliant and my last formal mathematics was Year 11 high school 39 years ago (so I never actually graduated). I've come here to try to get my maths up to speed, so I can work these problems out properly.
Problem Loading...
Note Loading...
Set Loading...
Here is how you determine all 2 0 1 8 coefficients.
First you input x 0 = 1 and the computer would give you p ( 1 ) , which is the sum of all coefficents.
let s = p ( 1 )
Then you input x 1 = s + 1 , and the computer would give you p ( s + 1 ) .
Converting p ( s + 1 ) to base s + 1 and the digits correspond to the coefficients of p ( x ) .
Because
p ( s + 1 ) = d 2 0 1 7 ( s + 1 ) 2 0 1 7 + d 2 0 1 6 ( s + 1 ) 2 0 1 6 + ⋯ + d 2 ( s + 1 ) 2 + d 1 ( s + 1 ) + d 0
is exactly how we represent integers in base s + 1
we use s = p ( 1 ) to make sure that the second number we input is larger than any of the coefficients.
This works for p ( x ) of arbitrary degrees, as long as all coefficient are nonnegative integers.