Post Reply 
Problem with 2nd order polynomial
09-18-2024, 08:19 AM (This post was last modified: 09-18-2024 09:05 AM by ktomp.)
Post: #1
Problem with 2nd order polynomial
Hello everyone,

I got an exam the other day and to my surprise my HP prime (G1 hardware) failed to solve a 2nd order polynomial (a*x^2+b*x+c = 0) with the following coefficients:
a = 30188156.0038281

b = -12497373621.6526

c = 1058636761186.350

I was in CAS mode and tried using the Solve, Zeros, Numerical Solve but only got empty brackets as a result (like []). Same thing happens even with the latest update of 2024/09.

It's probably due to the fact that the coeffecients of the polynomial where quite large numbers, cause when I divided everything with the "a" coefficient and the polynomial became x^2+(b/a)*x+(c/a) all the functions managed to find the roots correctly.

Could this be a bug?

Many thanks for your help


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
09-18-2024, 01:16 PM (This post was last modified: 09-18-2024 08:37 PM by Patocuy.)
Post: #2
RE: Problem with 2nd order polynomial
Hi.
I used proot and solve and got the same solutions with both functions, perhaps solve needs to know which variable you are solving for.

UPDATE

Now I used the same syntax as you, without specifying the variable to solve for and got the same solutions as before. You could use purge(x) to be sure that x has no value assigned and check your CAS settings, I have attached mine so you can compare.

Regards


Attached File(s) Thumbnail(s)
           
Find all posts by this user
Quote this message in a reply
09-19-2024, 06:58 AM
Post: #3
RE: Problem with 2nd order polynomial
Hi, thanks for trying to help me out.

I only managed to get solutions with proot() function. Solve() won't return solutions regardless of the syntax. I even purged x just to be sure, but to no avail.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
09-19-2024, 02:53 PM (This post was last modified: 09-19-2024 03:03 PM by C.Ret.)
Post: #4
RE: Problem with 2nd order polynomial
Hi guys!

Just look at this and compare:

[Image: attachment.php?aid=13971]

What are your conclusions or assumptions? Are they the same as the one I just made?

How did the CAS-solve statement work out numerically compared to other specific and only numeric functions?
Did you understand what happened with CAS-solve when an interval is given for the numerical variable x? Why this works in the first case?

Hope this helps you a little.

And that the prankster HP Prime didn't ruin all of ktomb 's hopes of passing his exam!


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
09-19-2024, 06:16 PM
Post: #5
RE: Problem with 2nd order polynomial
I have been trying to understand this thread.

How can the estimates for x be obtained without running proot first?

There are significant differences of values for 'c' in the two images b C.Ret.
Why are there differences between the two solve answers.

What are the answers to the questions that C.Ret posed?

I hhave limited experiences with the type of problem that ktomb asked on the prime.

Thanks.
Find all posts by this user
Quote this message in a reply
09-20-2024, 02:46 AM
Post: #6
RE: Problem with 2nd order polynomial
It worked for me without any issues. Using my iPad app


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
09-20-2024, 07:45 PM (This post was last modified: 09-20-2024 07:46 PM by C.Ret.)
Post: #7
RE: Problem with 2nd order polynomial
(09-19-2024 06:16 PM)Liamtoh Resu Wrote:  How can the estimates for x be obtained without running proot first?

That's an excellent question. The only answer I know is that it's impossible unless you use divination magic.

There are no estimates because these are more precisely the limits of an interval. Only one estimate can be given to the solve instruction.

I have to apologize to you because I just realized that I left the 5-digits rounding that I usually use to make the captures.

In reality, I used the exact values ​​of a,b and c given by ktomb (at least the closest representation the HP Prime is able, since the numeric values he gives are far more precise that possible on an HP Prime).

Between the two captures these three values a,b and c ​​were simply divided by 10,000,000. Which means that it does not change the position of the roots of the quadratic polynomial \(a\cdot x^2 + b\cdot x + c \).
On the other hand, it has a non-negligible effect on the amplitude of all non-zero values of this quadratic.

This simple difference seems to dramatically change the operation of the solve instruction. But not if we give an estimate or a search interval.


If I were asked for advice, I would strongly recommend that any experienced HP Prime user to use the two modes HOME and CAS wisely.
* HOME mode for numerical calculations and resolutions only.
* CAS mode for symbolic calculations only.

The two screenshots below attempt to illustrate what I think would be a better use of the facetious HP Prime:
[Image: attachment.php?aid=13976]
( I took care to use the STANDARD display mode even if I find it a bit stupid to have such long numbers with so many digits that make no sense. )

On the left, the HOME mode gives the numerical results immediately and without detour.
On the right, the CAS mode naturally gives an exact symbolic answer. Eventually, that symbolic answer may be exploited numerically.

Most often, incidents occur when one tries to obtain a solution that is simultaneously symbolic and numerical. These are two different realities, two philosophies that turn their backs on each other, two faces of the same mirror...


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
09-20-2024, 10:17 PM
Post: #8
RE: Problem with 2nd order polynomial
Thanks C.Ret for your additional screenshots and explainations.
Find all posts by this user
Quote this message in a reply
09-23-2024, 07:08 AM (This post was last modified: 09-23-2024 07:10 AM by ktomp.)
Post: #9
RE: Problem with 2nd order polynomial
Thank you so much for taking the time to investigate the issue and provide helpful information.

Good news is that I passed the exam, but I waisted a good 5-10 minutes trying to fingure out what's wrong with my calculator and finally calculating it manually by typing the quadratic formula, which made me rush the next part of the exam which then led me to silly mistakes from which I lost at least 2 marks (exam result scale is 0 to 10).

Next time I will use the proot or remember to divide all coefficients with a number to get smaller coefficients. Typically I work on CAS when solving an excersice and don't like switching back and forth with HOME mode.

proot() seems to work ok though, I just was not aware that it existed in the list of avaliable functions.

Many thanks for your help again!
Find all posts by this user
Quote this message in a reply
Post Reply 




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