Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

The New Coffee Room

  1. TNCR
  2. General Discussion
  3. Puzzle time - Recovering the Polynomial

Puzzle time - Recovering the Polynomial

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 51 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Online
    J Online
    jon-nyc
    wrote on 22 May 2022, 14:40 last edited by
    #1

    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?

    They’ll end up, after a lot of drama, with the same formula they use every time they have a trifecta: take away health care and food assistance from low income families and use the money to fund tax cuts for their donors.

    1 Reply Last reply
    • H Offline
      H Offline
      Horace
      wrote on 22 May 2022, 17:27 last edited by Horace
      #2

      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.

      Education is extremely important.

      1 Reply Last reply
      • K Offline
        K Offline
        Klaus
        wrote on 22 May 2022, 18:38 last edited by
        #3

        I'd start with p(1).

        If p(1) = m , then all coefficients must be <= m.

        That reduces the number of candidates quite a bit.

        1 Reply Last reply
        • K Offline
          K Offline
          Klaus
          wrote on 22 May 2022, 18:41 last edited by Klaus
          #4

          Ah, I think I got it!

          click to show

          Assume all coefficients were <= 9.

          Then a Oracle single invocation would suffice, namely p(10). The digits of the results would be the coefficients because p(10) = d-n 10^n + ... + d-0 10^0 = d-n...d-0.

          But we can apply the same trick when we only know an upper bound m on the coefficient; we simply take p(m+1) and interpret the result as a number in base m+1. Again, the digits of the result will be the coefficients.

          I already explained above how to get the upper bound with one invocation. In total, it takes just two invocations of the oracle!

          H 1 Reply Last reply 22 May 2022, 19:00
          • K Klaus
            22 May 2022, 18:41

            Ah, I think I got it!

            click to show

            Assume all coefficients were <= 9.

            Then a Oracle single invocation would suffice, namely p(10). The digits of the results would be the coefficients because p(10) = d-n 10^n + ... + d-0 10^0 = d-n...d-0.

            But we can apply the same trick when we only know an upper bound m on the coefficient; we simply take p(m+1) and interpret the result as a number in base m+1. Again, the digits of the result will be the coefficients.

            I already explained above how to get the upper bound with one invocation. In total, it takes just two invocations of the oracle!

            H Offline
            H Offline
            Horace
            wrote on 22 May 2022, 19:00 last edited by
            #5

            @Klaus said in Puzzle time - Recovering the Polynomial:

            Ah, I think I got it!

            click to show

            Assume all coefficients were <= 9.

            Then a Oracle single invocation would suffice, namely p(10). The digits of the results would be the coefficients because p(10) = d-n 10^n + ... + d-0 10^0 = d-n...d-0.

            But we can apply the same trick when we only know an upper bound m on the coefficient; we simply take p(m+1) and interpret the result as a number in base m+1. Again, the digits of the result will be the coefficients.

            I already explained above how to get the upper bound with one invocation. In total, it takes just two invocations of the oracle!

            click to show

            Oh, yeah, boils down to a way of thinking in number bases. Nice.

            Education is extremely important.

            1 Reply Last reply
            • J Online
              J Online
              jon-nyc
              wrote on 23 May 2022, 02:31 last edited by jon-nyc
              #6

              Very nice Klaus and a very surprising result given it works for any n.

              They’ll end up, after a lot of drama, with the same formula they use every time they have a trifecta: take away health care and food assistance from low income families and use the money to fund tax cuts for their donors.

              1 Reply Last reply
              • K Offline
                K Offline
                Klaus
                wrote on 23 May 2022, 07:30 last edited by
                #7

                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).

                1 Reply Last reply
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes

                3/7

                22 May 2022, 18:38


                • Login

                • Don't have an account? Register

                • Login or register to search.
                3 out of 7
                • First post
                  3/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups