![]() |
A Math Challenge (kind of) - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: A Math Challenge (kind of) (/thread-190790.html) |
A Math Challenge (kind of) - Namir - 08-16-2011 Hi All, I am interested in the algorithm that allows me to determine the coefficients (A) and order of a polynomial (N) that: 1. Passes through a specified set of roots (n1 roots). 2. Passes through a specified set of minima (n2 minima). 3. Passes through a specified set of maxima (n3 maximum). Doing just #1 is easy as pie!! Doing 1 and 2, 1 and 3, or 1, 2, and 3 is hard. Any ideas? Namir
Edited: 16 Aug 2011, 3:22 p.m.
Re: A Math Challenge (kind of) - Marcus von Cube, Germany - 08-16-2011 Namir, is n1 the exact number of roots or the minimum number of roots? for #1 alone, this is simple, it's just the product (x-xi) where xi are the roots. To put #2 or #3 into the equation, you may or may not need to multiply in more factors so that f'(x) has roots at the specified minima or maxima and f"(x) is positive for #2 and negative for #3.
Can you give a concrete example of values so that we can experiment with the problem?
Re: A Math Challenge (kind of) - Namir - 08-16-2011 n1 is the number of roots that you choose (and specify the values of the roots).
Namir
Re: A Math Challenge (kind of) - Namir - 08-16-2011 Here is an example: 1. Roots at -1, 0.125, and 1. 2. Maximum at 0.
3. Minimum at 0.5. Edited: 16 Aug 2011, 5:33 p.m.
Re: A Math Challenge (kind of) - C.Ret - 08-16-2011 Namir, I have to repeat the question of [u][b]Marcus[/u][/b] which is of primary importance. If the three roots you give are the only one of the polymer, there is no solution to your problem.
If -1, 1/8 and 1 are the only and simple roots of the polymer P(x), then P(x) is exactly of degree 3. P(x) = a.x3 + b.x2 + c.x + d. From (eq.4) and (eq.5) b = -3a/4
The point 0 is a maximum if P"(0) negative. P"( 0 ) < 0 b < 0 (eq.6)
The point ½ is a minimum if P"(1/2) is positive. P"( 1/2 ) > 0 3a + 2b > 0 (eq.6)
At this point , we have to found a set of coefficients :
From (eq.2) : a/512 - 3a/128 - 3a/4 == 0 Thus, no such a polymer exist ! It may only be a solution if the polymer is of a greater degree. OK, I found no evident solution, but my approch clearly show that an appropriate algorithm may be lead by linear algebra, system of equations and inequations.
Edited: 16 Aug 2011, 7:59 p.m.
Re: A Math Challenge (kind of) - Namir - 08-16-2011 A polynomial with a higher degree is fine. This means it will have additional roots (real or complex) and that's fine. As long as the resulting example polynomial has the properties I gave. Thanks for your efforts!!
Namir
Re: A Math Challenge (kind of) - fhub - 08-17-2011 Quote: The solution (i.e. the lowest degree polynomial) to this problem is: f(x) = k*(-88*x^5 + 75*x^4 + 88*x^3 - 76*x^2 + 1) where k can be any positive number. Franz
Re: A Math Challenge (kind of) - Namir - 08-17-2011 Thank you!! The whole idea about getting a "custom" polynomial arose when I was trying to select simple polynomials to study the calculations of their roots. Using the form of p(x)=product(x - root(i)) was intuitive but yielded a few polynomials that did not have much rise in values between two roots that I was interested in. So I began to ask about getting custom polynomials where I cans specify not only the roots but also certain maxima and minima between these roots.
Namir
Re: A Math Challenge (kind of) - Marcus von Cube, Germany - 08-17-2011 Franz, you caught me on the finish line, I was just verifying my results with Derive. :-)
My normalized result (pasted from Derive): 5 4 3 2 The idea: P(x)=A(x)*B(x) where B(x) is the product of (x-x0i) and A(x) is a yet to determine polynomial. I tried with: B(x)=u*x2+v*x+w. After some pencil and paper computations I arrived at: v=8, u=-11/8*v=-11 and w=v/8=1
It has all the requested properties, especially the derivative is 0 at 0 and 1/2 and the second derivative is negative for 0 and positive for 1/2. I let Derive do the dirty work of computing the coefficients of A(x)B(x) and did the normalization by hand.
Re: A Math Challenge (kind of) - fhub - 08-17-2011 Well, if your requirements (given in your first post) 1. Passes through a specified set of roots (n1 roots).fulfill the condition that all your given extrema are between 2 roots and maxima and minima are alternating (i.e. root,min,root,max,root,min,root, etc), then the algorithm is quite simple (and has been mentioned already in parts):
1) Choose a polynomial of degree n=n1+n2+n3: (highest coeff can be 1)
I did even use a bit shorter way:
One problem still remains: BTW: if you don't only give the arguments (x-value) for the extrema but also the function value (y), then of course you'll have to increase the polynomial-degree by 1 for each additional condition. Franz
Edited: 17 Aug 2011, 9:22 a.m.
Re: A Math Challenge (kind of) - fhub - 08-17-2011 Quote:Well Marcus, we both seem to be quite similar and come from the same 'good old school'! ;-)
I also did it almost exactly the same way as you, and I also did use Derive (for such simple tasks I even use the old DOS Derive 3!) - really funny! :-)
Re: A Math Challenge (kind of) - Patrice - 08-17-2011 Hi Namir, Just to be precise, how should I understand the values ?
1) or
2)
Patrice
Re: A Math Challenge (kind of) - Patrice - 08-17-2011 hi Marcus, Are you sure about the polynomial of degree 5 ? I agree that I did not play with polynomials since a very long time. But as far as I remember, a polynomial of degree 3 can have 3 roots and 1 minima and 1 maxima.
Patrice
Re: A Math Challenge (kind of) - fhub - 08-17-2011 Quote:I'm not Marcus, but nevertheless ... ;-) If you construct a 3-degree polynomial with the 3 given roots, then its maximum and minimum are NOT at the given x-values (unless it's by chance). So you have to choose a higher degree to fulfill also these extrema conditions.
Franz
Re: A Math Challenge (kind of) - Bunuel66 - 08-17-2011 It seems that the roots for minima and maxima should be alternated. If there is a minimum at x1 then the derivative will have its sign being negative on the left of x1 and positive on the right (- +), conversely for a maximum (+ -). Then lets assume that two minima are consecutive we shall have a sequence of (-+)(-+) for the sign of the derivative, but then we also have a sequence -(+-)- which shows that there is local maximum between the two minima, which is contradictory with the initial hypothesis.
Regards
Re: A Math Challenge (kind of) - Marcus von Cube, Germany - 08-17-2011 The solutions presented so far deal with you option (1).
Re: A Math Challenge (kind of) - Kiyoshi Akima - 08-17-2011 I don't believe the original requirements stated that all of the maxima (or minima) are given. It's possible for a polynomial to have more than one minima and maxima between two roots.
Re: A Math Challenge (kind of) - Gilles Carpentier - 08-17-2011 Hi, here is an HP50G program based on the analyses of Marcus and Franz. It would be easy to generalise it and input the roots, minima and maxima as parameters. I don't verify here the sign of extremums (mini maxi)but it's easy to change ( by example in exploring the TABVAR result, and the Up / Down variation around the extremum ( Down Up) give a minimum and ( Up Down) a maximum). I got :
Eq : '(144*X^5-116*X^4-144*X^3+121*X^2-5)/144' For generalisation, could be something like :
{ Root1 Multiplicity Root2 Multiplicity etc. }
and change dynamically the number of a b c d... parameters depending of the number of extrema Gilles PS : generic version :
Edited: 18 Aug 2011, 1:51 p.m.
|