Math brain teaser - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Calculators (and very old HP Computers) ( /forum-3.html)+--- Forum: General Forum ( /forum-4.html)+--- Thread: Math brain teaser ( /thread-252.html)Pages: 1 2 |

Math brain teaser - Han - 12-27-2013 05:18 AM
This was a cute problem that was sent my way a long time ago. It took me a while to come up with the answer, but very cool once you figure it out. A computer generates a random polynomial whose coefficients are non-negative integers. You are allowed to ask the computer to evaluate the polynomial at two values. What two values do you choose in order to completely determine the coefficients? RE: Math brain teaser - Les_Koller - 12-27-2013 05:54 AM
Just read this gem on the National Council of Teacher's of Mathematics web page for the first time last night! (I teach High School Algebra). Thought I'd set it aside till tomorrow, very interesting problem. Now that I see it mentioned here, you've got me intrigued, and I'm pulling out pencil and paper. Hope I can report success soon! RE: Math brain teaser - Les_Koller - 12-27-2013 07:41 AM
OK, I think I actually have a couple of answers that are correct. I'll wait til others post to see if someone gets both of mine. RE: Math brain teaser - Namir - 12-27-2013 01:24 PM
We evaluate the polynomial at m1=P(1) and m2=P(m1+1). The value m1 gives us the sum of the polynomial coefficients. We use that value to breakdown the value of m2 into the polynomial coefficients using integer divisions and modulo operators (or equivalent operations). Here is a pseudo code for the solution: Code: `m1=P(1)` P(x) is the polynomial with the given positive integer coefficients evaluated at X. The array A() contains the calculated polynomial coefficients, such that: P(X,A) = A(0) + A(1)*X + A(2)*X^2 + ... + A(N)*X^N RE: Math brain teaser - Han - 12-27-2013 05:29 PM
(12-27-2013 01:24 PM)Namir Wrote: We evaluate the polynomial at m1=P(1) and m2=P(m1+1). The value m1 gives us the sum of the polynomial coefficients. We use that value to breakdown the value of m2 into the polynomial coefficients using integer divisions and modulo operators (or equivalent operations). Here is a pseudo code for the solution: Hi Namir, That's an interesting approach! Allow me to make the brain teaser a bit more interesting. Let's suppose now the the computer is a gatekeeper. Due to a time-space anomaly, you have been thrown into the far, far future and are trying to find your way back to your current timeline. The only way to do so is to determine all the coefficients of the polynomial. The computer has a display that is capable of displaying infinite precision integers (and you can see all digits at once), and a keypad with which you may enter your values for evaluation. The catch, however, is that you have no pen, no paper, no calculator (basically nothing with which you may do any sort of calculations except for your own mind) and only a few minutes to answer the riddle to return back to your time, or forever be stuck! Can you devise a new scheme to solve the riddle and get back home? RE: Math brain teaser - Thomas Klemm - 12-27-2013 05:56 PM
(12-27-2013 05:29 PM)Han Wrote: Can you devise a new scheme to solve the riddle and get back home? m1 = P(1) m2 = P(10^k) where k is the number of digits of m1 RE: Math brain teaser - Han - 12-27-2013 06:13 PM
(12-27-2013 05:56 PM)Thomas Klemm Wrote:(12-27-2013 05:29 PM)Han Wrote: Can you devise a new scheme to solve the riddle and get back home? Nicely done! RE: Math brain teaser - Namir - 12-27-2013 10:02 PM
Good alternate solution!!! Namir RE: Math brain teaser - Paul Dale - 12-27-2013 10:52 PM
They are essentially the same solution, just using a different base. The first is extracting the digits base m1+1, the second base k. The second is easier for a human to read of course. - Pauli RE: Math brain teaser - Han - 12-27-2013 11:00 PM
When I first saw this problem, I came up with the same solution as Thomas. It didn't even occur to me to think about other solutions (or even other bases). RE: Math brain teaser - Les_Koller - 12-28-2013 02:03 AM
I ask for p(a), then p(p(a)). Alternatively, ask for p(pi). IF the computer absolutely HAS to deliver exact answers, you will get your answer quickly. For instance, if P = 13x^4 + 10x^2 + x + 8, you get 13 pi^4 + 10 pi^2 + pi + 8. RE: Math brain teaser - Paul Dale - 12-28-2013 02:45 AM
p(a) and p(p(a)) doesn't quite work. Take a polynomial where p(a) = a. The second evaluation produces no new information and you cannot distinguish between p(x) = x and p(x) = a. - Pauli RE: Math brain teaser - walter b - 12-28-2013 04:31 AM
(12-28-2013 02:03 AM)Les_Koller Wrote: I ask for p(a), then p(p(a)). Alternatively, ask for p(pi). IF the computer absolutely HAS to deliver exact answers, you will get your answer quickly. For instance, if P = 13x^4 + 10x^2 + x + 8, you get 13 pi^4 + 10 pi^2 + pi + 8. (12-28-2013 02:45 AM)Paul Dale Wrote: p(a) and p(p(a)) doesn't quite work. Take a polynomial where p(a) = a. The second evaluation produces no new information and you cannot distinguish between p(x) = x and p(x) = a.Let me modify Les' solution a bit: I'd ask for p(pi) and p(e). So I'd get two answers allowing me to exclude the case Pauli mentioned. Thanks, Les, for the basic idea! d:-) RE: Math brain teaser - Thomas Klemm - 12-28-2013 11:11 AM
(12-28-2013 04:31 AM)walter b Wrote: I'd ask for p(pi) and p(e).You're dead before entering all the digits of \(\pi\). Have a nice time in the future ... RE: Math brain teaser - Thomas Klemm - 12-28-2013 11:20 AM
(12-27-2013 10:52 PM)Paul Dale Wrote: the second base kIt's \(10^k\). RE: Math brain teaser - Paul Dale - 12-28-2013 11:58 AM
Sorry, it is \(10^k\). - Pauli RE: Math brain teaser - walter b - 12-28-2013 12:17 PM
(12-28-2013 11:11 AM)Thomas Klemm Wrote: You're dead before entering all the digits of \(\pi\).Thanks for the good wishes, although I'd just enter \(\pi\) with two keystrokes d:-) RE: Math brain teaser - Thomas Klemm - 12-28-2013 12:55 PM
(12-28-2013 12:17 PM)walter b Wrote: I'd just enter \(\pi\) with two keystrokesYou should know better that they are always cheating with this key: they write \(\pi\) on it but all you get is a rational approximation. So I'm afraid that won't help you much. RE: Math brain teaser - Les_Koller - 12-28-2013 09:21 PM
Seriously? You don't have to (in fact CANNOT) use all the digits of pi. If the computer is REQUIRED to deliver the CORRECT answer, it will have CAS built-in and use PI as a symbol, just like the 50g or prime or nspire or any other number of calculators. Using PI and e (I see the necessity of both) will suffice. RE: Math brain teaser - Thomas Klemm - 12-29-2013 12:10 AM
And I thought you chose \(\pi\) because it's transcedent. But then any symbol like \(x\) or \(t\) will do. (12-28-2013 09:21 PM)Les_Koller Wrote: Using PI and e (I see the necessity of both) will suffice. Can you elaborate on that? Why would you need both? |