Post Reply 
Short & Sweet Math Challenge #21: Powers that be
11-08-2016, 10:24 PM
Post: #20
RE: Short & Sweet Math Challenge #21: Powers that be
(11-08-2016 01:38 PM)Paul Dale Wrote:  I'd figured out an approach to this problem. I've not implemented it on any hardware.

It is essentially a brute force approach to the problem:

For each length of polynomial (1 .. 8):
  • Iterate over all polynomials for the given length that satisfy the specified constraints. That the leading coefficient is 1, the constant term is ±1 and the remaining term coefficients are from {-1, 0, 1}.
  • Over all lengths there are 6560 such polynomials. If the constant term can also be 0, the count is 9840.
  • Find the roots of each polynomial.
  • If there is one real root > 1 and all of the remaining (possibly complex) roots have |root| < 1, then the polynomial is of the required form.

My approach is similar to Paul's. One subroutine sequentially cycles through all coefficients - 1, 0, -1, starting with 1 1 1 1 1 1 1 1 1. The other routine uses the solver to check for roots in the proscribed range. Coded for the 15C, the routines appear to work independently, but not sure how they will behave together across the whole range.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Short & Sweet Math Challenge #21: Powers that be - Dwight Sturrock - 11-08-2016 10:24 PM



User(s) browsing this thread: 1 Guest(s)